]> granicus.if.org Git - cronie/commitdiff
init script: remove bashisms
authorSami Kerola <kerolasa@iki.fi>
Sun, 2 Dec 2012 00:04:21 +0000 (00:04 +0000)
committerTomas Mraz <tmraz@fedoraproject.org>
Fri, 21 Dec 2012 21:07:31 +0000 (22:07 +0100)
References: https://sourceforge.net/projects/checkbaskisms/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
cronie.init

index 1559b34b372279dddf7b48768d9155d420280b07..5b9e88c978553923bf9f59b153a0bacc6b4f46ba 100755 (executable)
@@ -37,13 +37,13 @@ config=/etc/sysconfig/crond
 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
 start() {
-    if [ $UID -ne 0 ] ; then
+    if [ $(id -ru) -ne 0 ] ; then
         echo "User has insufficient privilege."
         exit 4
     fi
     [ -x $exec ] || exit 5
     [ -f $config ] || exit 6
-    echo -n $"Starting $prog: "
+    printf "Starting $prog: "
     daemon $prog $CRONDARGS
     retval=$?
     echo
@@ -51,16 +51,16 @@ start() {
 }
 
 stop() {
-    if [ $UID -ne 0 ] ; then
+    if [ $(id -ru) -ne 0 ] ; then
         echo "User has insufficient privilege."
         exit 4
     fi
-    echo -n $"Stopping $prog: "
+    printf "Stopping $prog: "
        if [ -n "`pidfileofproc $exec`" ]; then
                killproc $exec
                RETVAL=3
        else
-               failure $"Stopping $prog"
+               failure "Stopping $prog"
        fi
     retval=$?
     echo
@@ -73,11 +73,11 @@ restart() {
 }
 
 reload() {
-       echo -n $"Reloading $prog: "
+       printf "Reloading $prog: "
        if [ -n "`pidfileofproc $exec`" ]; then
                killproc $exec -HUP
        else
-               failure $"Reloading $prog"
+               failure "Reloading $prog"
        fi
        retval=$?
        echo
@@ -125,7 +125,7 @@ case "$1" in
         restart
         ;;
     *)
-        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
         exit 2
 esac
 exit $?