From 16e0ca7bd39edaf5fd142aa4d561bff2701d5b56 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 12 May 2022 09:32:39 +0200 Subject: 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 --- setup-devd.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'setup-devd.in') 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)) -- cgit v1.2.3