diff options
| author | Clément Zrounba <6691770+clement-z@users.noreply.github.com> | 2021-01-16 17:48:28 +0100 |
|---|---|---|
| committer | Clément Zrounba <6691770+clement-z@users.noreply.github.com> | 2021-01-16 17:48:28 +0100 |
| commit | 909ec946440d1a80c23f7e23a90d83823c8557b1 (patch) | |
| tree | 65860a9bb87048d9a18b2b391332c5a2069f588f | |
| parent | 9d323266b9fecbaeb8118947edf662fdf28cb77c (diff) | |
| download | proxy-tcp-ssh-909ec946440d1a80c23f7e23a90d83823c8557b1.tar.gz proxy-tcp-ssh-909ec946440d1a80c23f7e23a90d83823c8557b1.zip | |
Fix checking for -t and -S before --help
| -rwxr-xr-x | proxy-tcp-ssh.sh | 27 |
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} |
