diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 17:03:52 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-13 15:52:55 +0200 |
commit | 64b0a5dfab682b68231fe1d0da0534398f7b7ba4 (patch) | |
tree | df366ecea533248d082e6729321c737863edaccc | |
parent | f122f4397555f0177a3c74168078750a71a03ff0 (diff) | |
download | alpine-conf-64b0a5dfab682b68231fe1d0da0534398f7b7ba4.zip |
setup-ntp: only send usage help on error
send -h to stdout
-rw-r--r-- | setup-ntp.in | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/setup-ntp.in b/setup-ntp.in index da649a7..6438e25 100644 --- a/setup-ntp.in +++ b/setup-ntp.in @@ -1,11 +1,11 @@ #!/bin/sh PREFIX=@PREFIX@ - -. "$PREFIX/lib/libalpine.sh" +: ${LIBDIR=$PREFIX/lib} +. "$LIBDIR/libalpine.sh" usage() { - cat <<-__EOF__ + cat >&$(( $1 + 1 ))<<-__EOF__ usage: setup-ntp [-h] [-c choice of NTP daemon] Setup NTP time synchronization @@ -14,13 +14,14 @@ usage() { -h Show this help -c Choice of NTP daemon: busybox openntpd chrony none __EOF__ - exit 1 + exit $1 } while getopts "hc:" opt; do case $opt in c) resp="$OPTARG";; - h) usage;; + h) usage 0;; + '?') usage 1;; esac done |