Author: glen                         Date: Thu Mar 29 15:07:09 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   rstatd.init (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: SOURCES/rstatd.init
diff -u SOURCES/rstatd.init:1.10 SOURCES/rstatd.init:1.11
--- SOURCES/rstatd.init:1.10    Thu Dec  8 02:02:49 2005
+++ SOURCES/rstatd.init Thu Mar 29 17:07:04 2007
@@ -24,10 +24,7 @@
 # Get rstatd config
 [ -f /etc/sysconfig/rstatd ] && . /etc/sysconfig/rstatd
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/rstatd ]; then
                msg_starting rstatd
@@ -37,8 +34,9 @@
        else
                msg_already_running rstat
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/rstatd ]; then
                msg_stopping rpc.rstatd
                killproc rpc.rstatd
@@ -46,15 +44,24 @@
        else
                msg_not_running rstatd
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status rpc.rstatd
        exit $?
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/rstatd.init?r1=1.10&r2=1.11&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to