diff options
Diffstat (limited to 'debvm-waitssh')
-rwxr-xr-x | debvm-waitssh | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/debvm-waitssh b/debvm-waitssh index e4f05ee..9e61a64 100755 --- a/debvm-waitssh +++ b/debvm-waitssh @@ -28,7 +28,8 @@ Defaults to one minute. =item B<-q>, B<--quiet> -Be quiet. Output nothing on standard error, not even error messages. +Be quiet. +Do not output a message when the timeout has been reached without success. =back @@ -144,12 +145,8 @@ case "$1" in esac case "$HOST" in *@*) - if [ "$VERBOSITY" -ge 1 ]; then - echo "$0: hostname '$HOST' must not contain the '@' character. No username is required." >&2 - fi - exit 2 - ;; -esac + die "$0: hostname '$HOST' must not contain the '@' character. No username is required." +;; esac # Guard against strings containing anything but digits, strings starting with # zero and empty strings as the port number. @@ -157,12 +154,11 @@ esac # We cannot use [!0-9] because that matches on any character (or possibly # multi-character collation element) that sorts in between 0 and 9. case "$PORT" in *[!0123456789]*|0?*|""|??????*) - if [ "$VERBOSITY" -ge 1 ]; then - echo "$0: port '$PORT' is not a positive integer between 1 and 99999" >&2 - fi - exit 2 - ;; -esac + die "$0: port '$PORT' is not a positive integer between 1 and 65535" +;; esac +if test "$PORT" -lt 1 -o "$PORT" -gt 65535; then + die "$0: port '$PORT' is not a positive integer between 1 and 65535" +fi now=$(date +%s) deadline=$((now + TOTALTIMEOUT)) |