From 71c549b64d15c2a7b3736f21f65cf6ca4dbb7ee0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 25 Jan 2012 15:27:26 +0100 Subject: check for getopts before using it busybox sh doesn't have it and will now display an error. Signed-off-by: Florian Pritz --- fb.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fb.in b/fb.in index 3287deb..561a2df 100644 --- a/fb.in +++ b/fb.in @@ -180,6 +180,11 @@ usage: [cat |] `basename "$0"` [switches] [options] [] ! } +if ! type getopts >/dev/null 2>&1; then + echo "Error: getopts is not supported by your shell" >&2 + exit 1 +fi + while getopts "e:gdhHtcv" OPTION; do case $OPTION in e) EXTENSION="$OPTARG";; -- cgit v1.2.3-24-g4f1b