From d8464cf5842a3c261ecf5cdb769bbeea292da512 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Wed, 24 Dec 2003 19:46:40 +0000 Subject: [PATCH] - use internal shell getopts instead of external getopt binary Changed files: bootsplash-bootanim.script -> 1.4 --- bootsplash-bootanim.script | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/bootsplash-bootanim.script b/bootsplash-bootanim.script index bd9af1d..8418883 100644 --- a/bootsplash-bootanim.script +++ b/bootsplash-bootanim.script @@ -41,7 +41,7 @@ if [ "$UID" -ne "0" ]; then fi THEME="No theme selected" -test -f /etc/sysconfig/bootsplash && . /etc/sysconfig/bootsplash +[ -f /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash if [ ! -d /etc/bootsplash/themes/$THEME ] then @@ -61,17 +61,17 @@ start) ;; stop) # echo "$0 stop" - killall -q -2 fbmngplay + /bin/killall -q -2 fbmngplay exit 0 ;; kill) # echo "$0 kill" - killall -q fbmngplay + /bin/killall -q fbmngplay exit 0 ;; next) # echo "$0 next" - killall -q -USR1 fbmngplay + /bin/killall -q -USR1 fbmngplay exit 0 ;; *) @@ -84,35 +84,30 @@ esac shift # We end up in bootanim start - -TEMP=`getopt -o mr:d: -- "$@"` -eval set -- "$TEMP" - -while true ; do +set -x +while getopts mr:d: name "$@"; do # echo "loop: $*" - case "$1" in - -d) # directory + case "$name" in + d) # directory shift - if [ ! -d "$1" ]; then + if [ ! -d "$OPTARG" ]; then echo "Not a valid directory." exit 1 fi - DIRECTORY=$1 + DIRECTORY=$OPTARG shift ;; - -r) # resolution + r) # resolution shift - MODE=$1; + MODE=$OPTARG; shift ;; - -m) # multiple files + m) # multiple files shift OPTIONS="$OPTIONS -s" ;; - --) # end - shift - break;; *) # Weird + shift echo "Internal Error." exit 1 ;; -- 2.44.0