diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 09:32:39 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 09:32:39 +0200 |
commit | 16e0ca7bd39edaf5fd142aa4d561bff2701d5b56 (patch) | |
tree | ece563e8633b458222c9fd3706db771218ed875c /setup-devd.in | |
parent | 19e196f4977a1ecf67fdd5e4bff79fb2c41b9239 (diff) | |
download | alpine-conf-16e0ca7bd39edaf5fd142aa4d561bff2701d5b56.zip |
setup-devd: make script testable, fix -h usage option
Don't exit with error with -h specified.
Send usage text to stderr when there is a bad option
Diffstat (limited to 'setup-devd.in')
-rw-r--r-- | setup-devd.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/setup-devd.in b/setup-devd.in index 3a62c17..3f67d56 100644 --- a/setup-devd.in +++ b/setup-devd.in @@ -2,7 +2,8 @@ PREFIX=@PREFIX@ -. "$PREFIX/lib/libalpine.sh" +: ${LIBDIR=$PREFIX/lib} +. "$LIBDIR/libalpine.sh" prog="${0##*/}" @@ -23,7 +24,7 @@ udev (from eudev) is the complex, full-featured one. Without an argument, the choice is prompted interactively. EOF - exit 1 + exit $1 } disable_mdev () { @@ -91,9 +92,9 @@ enable_udev () { coldplug=false while getopts "hC" opt ; do case $opt in - h) usage ;; + h) usage 0;; C) coldplug=true ;; - '?') usage ;; + '?') usage 1 >&2;; esac done shift $((OPTIND - 1)) |