]> git.pld-linux.org Git - packages/nfs-utils.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 5 Apr 2007 07:07:36 +0000 (07:07 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpcidmapd.init -> 1.7

rpcidmapd.init

index bf4eedd2373cf5e3b1915249e7bcecc8cb35947b..0ab8fcea222c5f589905ba1290d0c90628ced309 100644 (file)
@@ -38,11 +38,7 @@ fi
 # Find out what the current runlevel dir is
 RUNLEVELDIR=$(cat /var/run/runlevel.dir)
 
-RETVAL=0
-
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/idmapd ]; then
                # This is whacko, but we need /proc/fs/nfsd mounted before
@@ -66,8 +62,9 @@ case "$1" in
        else
                msg_already_running "RPC idmapd"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/idmapd ]; then
                msg_stopping "RPC idmapd"
                killproc rpc.idmapd
@@ -75,15 +72,24 @@ case "$1" in
        else
                msg_not_running "RPC idmapd"
        fi
+}
+
+# See how we were called.
+RETVAL=0
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status rpc.idmapd
        RETVAL=$?
        ;;
   restart)
-       $0 stop
-       $0 start
-       RETVAL=$?
+       stop
+       start
        ;;
   reload)
        if [ -f /var/lock/subsys/idmapd ]; then
This page took 0.046453 seconds and 4 git commands to generate.