summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-12 17:03:52 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:52:55 +0200
commit64b0a5dfab682b68231fe1d0da0534398f7b7ba4 (patch)
treedf366ecea533248d082e6729321c737863edaccc
parentf122f4397555f0177a3c74168078750a71a03ff0 (diff)
downloadalpine-conf-64b0a5dfab682b68231fe1d0da0534398f7b7ba4.zip
setup-ntp: only send usage help on error
send -h to stdout
-rw-r--r--setup-ntp.in11
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