summaryrefslogtreecommitdiff
path: root/setup-sshd.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2021-01-08 11:39:21 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2021-01-08 11:39:21 +0100
commitd308d020518170ef06c82c69b3465e9151d1bb80 (patch)
tree69ce691966fdec3899d1eed4c1d8e1ed530ca024 /setup-sshd.in
parentc2f6f7d9f7b737d3dc90b3199872ab2c58e755ee (diff)
downloadalpine-conf-d308d020518170ef06c82c69b3465e9151d1bb80.zip
setup-sshd: improve error handling
repeat the question til we get a valid answer
Diffstat (limited to 'setup-sshd.in')
-rw-r--r--setup-sshd.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/setup-sshd.in b/setup-sshd.in
index 00e9bb8..67cb8a0 100644
--- a/setup-sshd.in
+++ b/setup-sshd.in
@@ -24,10 +24,10 @@ while getopts "hc:" opt; do
esac
done
-if [ "$sshdchoice" = "" ]; then
- echo -n "Which SSH server? ('openssh', 'dropbear' or 'none') [openssh] "
- default_read sshdchoice "openssh"
-fi
+while ! isin "$sshdchoice" openssh dropbear none; do
+ ask "Which SSH server? ('openssh', 'dropbear' or 'none')" openssh
+ sshdchoice="$resp"
+done
if [ "$sshdchoice" = "none" ]; then
exit 0