summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-01-25 15:27:26 +0100
committerFlorian Pritz <bluewind@xinu.at>2012-01-25 16:14:16 +0100
commit71c549b64d15c2a7b3736f21f65cf6ca4dbb7ee0 (patch)
tree2c68b088ca799c7cef05c23a886dc175cc5a4ffe
parentcc5474d7efe6845e2f89ac915d6e1289b26044b2 (diff)
check for getopts before using it
busybox sh doesn't have it and will now display an error. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--fb.in5
1 files changed, 5 insertions, 0 deletions
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] [<file(s)|ID(s)|folder(s)>]
!
}
+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";;