summaryrefslogtreecommitdiff
path: root/setup-ntp.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2021-01-08 13:43:44 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2021-01-08 13:43:44 +0100
commit1dd421231d2783db7441235e067875603ec9064e (patch)
tree6b6834e822edfb0e5668bff7f38587683287e0b0 /setup-ntp.in
parentbc4fff32768c6a44db454f2084dd60b860749746 (diff)
downloadalpine-conf-1dd421231d2783db7441235e067875603ec9064e.zip
setup-ntp: use ask for consistency
Diffstat (limited to 'setup-ntp.in')
-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
;;