diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 13:43:44 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 13:43:44 +0100 |
commit | 1dd421231d2783db7441235e067875603ec9064e (patch) | |
tree | 6b6834e822edfb0e5668bff7f38587683287e0b0 | |
parent | bc4fff32768c6a44db454f2084dd60b860749746 (diff) | |
download | alpine-conf-1dd421231d2783db7441235e067875603ec9064e.zip |
setup-ntp: use ask for consistency
-rw-r--r-- | setup-ntp.in | 13 |
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 ;; |