diff options
author | Johannes Schauer Marin Rodrigues <josch@mister-muffin.de> | 2023-01-08 20:45:42 +0100 |
---|---|---|
committer | Johannes Schauer Marin Rodrigues <josch@mister-muffin.de> | 2023-01-08 20:46:43 +0100 |
commit | 96349ad9ccb4a9c58c4cb32fefcf89d1a76a224f (patch) | |
tree | 533ba6d95b61815dcf701ed7858375c1f61e707d /debvm-waitssh | |
parent | 8c488b7655b924066930b57b4a0d2ff8be4296b6 (diff) | |
download | debvm-96349ad9ccb4a9c58c4cb32fefcf89d1a76a224f.tar.gz |
debvm-waitssh: error out if hostname contains @ character
Diffstat (limited to 'debvm-waitssh')
-rwxr-xr-x | debvm-waitssh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/debvm-waitssh b/debvm-waitssh index a35c783..32db862 100755 --- a/debvm-waitssh +++ b/debvm-waitssh @@ -14,7 +14,8 @@ B<debvm-waitssh> [B<-q>] [B<-t> I<timeout>] [I<hostname>:]I<port> =head1 DESCRIPTION B<debvm-waitssh> can be used to wait for a virtual machine with exposed ssh port to be reachable on that port. -If no hostname is given, B<127.0.0.1> is assumed. +If no hostname is given, B<127.0.0.1> is assumed. No authentication is attempted by B<debvm-waitssh>, so neither +a username nor a key have to be supplied. =head1 OPTIONS @@ -142,6 +143,14 @@ 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 1 + ;; +esac + # Guard against strings containing anything but digits, strings starting with # zero and empty strings as the port number. # |