From 1dd421231d2783db7441235e067875603ec9064e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 8 Jan 2021 13:43:44 +0100 Subject: setup-ntp: use ask for consistency --- setup-ntp.in | 13 ++++++------- 1 file 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 ;; -- cgit v1.2.3