commit 531d213c7da8140ed70bd4baf210299a9ea0b6a6
parent a8b1b40129533568df5729fca353273dec82c171
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 1 Apr 2014 16:37:51 +0200
respawn: remove getopts
this also makes it compatible with busybox ash. -dN is not supported
anymore however, but just use -d N.
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/bin/respawn b/bin/respawn
@@ -5,19 +5,16 @@ usage() {
exit 1
}
-delay=0
-while getopts ":d:" opt; do
- case $opt in
- d)
- delay=$OPTARG
+delay="0"
+case "$1" in
+ -d)
+ delay="$2"
+ shift 2
;;
- \?|:)
+ -h)
usage
;;
- esac
-done
-
-shift $((OPTIND-1))
+esac
if test -z $1; then
usage