summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-12 12:01:02 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-12 12:01:02 +0200
commit654cbd2971de0d3e18b7610d3e7b3bd025348d5b (patch)
tree16c7759d9b0b1f59793ad391f30827c6ba922ab7
parent6dacc04e8133d4d552eea8bb6a4c2070067d044d (diff)
downloadalpine-conf-654cbd2971de0d3e18b7610d3e7b3bd025348d5b.zip
setup-sshd: print usage on invalid option
-rw-r--r--setup-sshd.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/setup-sshd.in b/setup-sshd.in
index 18de60e..06ade79 100644
--- a/setup-sshd.in
+++ b/setup-sshd.in
@@ -23,6 +23,7 @@ while getopts "hc:k:" opt; do
h) usage 0;;
c) sshdchoice="$OPTARG";; # backwards compat
k) authorized_key="$OPTARG";;
+ '?') usage "1" >&2;;
esac
done
shift $(( $OPTIND - 1 ))
@@ -30,7 +31,7 @@ shift $(( $OPTIND - 1 ))
case "$1" in
openssh|dropbear|none) sshdchoice="$1" ;;
"") ;;
- *) usage 1 >&2;;
+ *) usage "1" >&2;;
esac
while ! isin "$sshdchoice" openssh dropbear none; do