summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup-ntp.in13
1 files changed, 6 insertions, 7 deletions
diff --git a/setup-ntp.in b/setup-ntp.in
index c88e486..e7871d9 100644
--- a/setup-ntp.in
+++ b/setup-ntp.in
@@ -19,19 +19,18 @@ usage() {
while getopts "hc:" opt; do
case $opt in
- c) ntpchoice="$OPTARG";;
+ c) resp="$OPTARG";;
h) usage;;
esac
done
-if [ -z "$ntpchoice" ]; then
- echo -n "Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none') [chrony] "
- default_read ntpchoice "chrony"
-fi
+while ! isin "$resp" busybox openntpd chrony none abort; do
+ ask "Which NTP client to run? ('busybox', 'openntpd', 'chrony' or 'none')" chrony
+done
-pkgs="$ntpchoice"
+pkgs="$resp"
-case "$ntpchoice" in
+case "$resp" in
none|abort)
exit 0
;;