aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xproxy-tcp-ssh.sh27
1 files changed, 13 insertions, 14 deletions
diff --git a/proxy-tcp-ssh.sh b/proxy-tcp-ssh.sh
index 98f2c19..ac30bb4 100755
--- a/proxy-tcp-ssh.sh
+++ b/proxy-tcp-ssh.sh
@@ -41,8 +41,7 @@ OPTIONS
EXAMPLES
Todo
AUTHOR
- Clément Zrounba
-"
+ Clément Zrounba"
}
function parse_args() {
@@ -112,18 +111,6 @@ function parse_args() {
;;
esac
done
-
- # Check SSHHOST is given
- if [ -z "$ARG_SSHHOST" ]; then
- echo "Error: no ssh host specified" >&2
- exit 1
- fi
-
- # Check TUNNELSPEC is given
- if [ -z "$ARG_TUNNELSPEC" ]; then
- echo "Error: no tunnel(s) specified" >&2
- exit 1
- fi
}
function check_low_port_cap()
@@ -171,6 +158,18 @@ if [ 0 == "$ARG_HELP" ]; then
exit 0
fi
+# Check SSHHOST is given
+if [ -z "$ARG_SSHHOST" ]; then
+ echo "Error: no ssh host specified" >&2
+ exit 1
+fi
+
+# Check TUNNELSPEC is given
+if [ -z "$ARG_TUNNELSPEC" ]; then
+ echo "Error: no tunnel(s) specified" >&2
+ exit 1
+fi
+
# Assign values or defaults to other parameters from ARG_* variables
SSH_HOST=${ARG_SSHHOST:-}
BIND_IF=${ARG_BIND_IF:-localhost}