diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-13 15:42:06 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-13 15:52:55 +0200 |
commit | 2e3774d619c80e69aa5659443098dbad5bb12bc6 (patch) | |
tree | 4422379b95fd4316105186c553023b5de3169c44 | |
parent | a039e6aa8d60509e17e3a22838adb3f6a0ec9264 (diff) | |
download | alpine-conf-2e3774d619c80e69aa5659443098dbad5bb12bc6.zip |
copy-modloop: add -h option and usage text
-rw-r--r-- | copy-modloop.in | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/copy-modloop.in b/copy-modloop.in index e72b645..8d57f5a 100644 --- a/copy-modloop.in +++ b/copy-modloop.in @@ -1,7 +1,28 @@ #!/bin/sh PREFIX=@PREFIX@ -. "$PREFIX/lib/libalpine.sh" +: ${LIBDIR=$PREFIX/lib} +. "$LIBDIR/libalpine.sh" + +usage() { + cat <<-__EOF__ + usage: copy-modloop + + Copy kernel modules from modloop and unmount loopback device + + options: + -h Show this help + __EOF__ + exit $1 +} + +while getopts "h" opt; do + case $opt in + h) usage 0;; + '?') usage "1" >&2;; + esac +done +shift $(($OPTIND - 1)) set -e |