diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 11:39:21 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 11:39:21 +0100 |
commit | d308d020518170ef06c82c69b3465e9151d1bb80 (patch) | |
tree | 69ce691966fdec3899d1eed4c1d8e1ed530ca024 | |
parent | c2f6f7d9f7b737d3dc90b3199872ab2c58e755ee (diff) | |
download | alpine-conf-d308d020518170ef06c82c69b3465e9151d1bb80.zip |
setup-sshd: improve error handling
repeat the question til we get a valid answer
-rw-r--r-- | setup-sshd.in | 8 |
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 |