diff options
Diffstat (limited to 'setup-hostname.in')
-rw-r--r-- | setup-hostname.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/setup-hostname.in b/setup-hostname.in index a655a58..c4f876a 100644 --- a/setup-hostname.in +++ b/setup-hostname.in @@ -24,18 +24,18 @@ usage() { valid_hostname() { # check length if [ $(echo "$1" | wc -c) -gt 255 ]; then - echo "Hostname '$1' is too long." + echo "Hostname '$1' is too long." >&2 return 1 fi # check that it only contains valid chars if ! [ -z "$(echo $1 | sed 's/[0-9a-z.-]//g')" ]; then - echo "Hostname must only contain letters (a-z), digits (0-9), '.' or '-'" + echo "Hostname must only contain letters (a-z), digits (0-9), '.' or '-'" >&2 return 1 fi # must not start with - or . case "$1" in - -*) echo "Hostname must not start with a '-'"; return 1;; - .*) echo "Hostname must not start with a '.'"; return 1;; + -*) echo "Hostname must not start with a '-'" >&2; return 1;; + .*) echo "Hostname must not start with a '.'" >&2; return 1;; esac return 0 } |