aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Zrounba <6691770+clement-z@users.noreply.github.com>2021-01-16 17:48:28 +0100
committerClément Zrounba <6691770+clement-z@users.noreply.github.com>2021-01-16 17:48:28 +0100
commit909ec946440d1a80c23f7e23a90d83823c8557b1 (patch)
tree65860a9bb87048d9a18b2b391332c5a2069f588f
parent9d323266b9fecbaeb8118947edf662fdf28cb77c (diff)
downloadproxy-tcp-ssh-909ec946440d1a80c23f7e23a90d83823c8557b1.tar.gz
proxy-tcp-ssh-909ec946440d1a80c23f7e23a90d83823c8557b1.zip
Fix checking for -t and -S before --help
-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}