Author: glen                         Date: Sat Oct 25 19:51:39 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions, add try-restart

---- Files affected:
SOURCES:
   proftpd.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/proftpd.init
diff -u SOURCES/proftpd.init:1.9 SOURCES/proftpd.init:1.10
--- SOURCES/proftpd.init:1.9    Thu Dec  8 01:41:26 2005
+++ SOURCES/proftpd.init        Sat Oct 25 21:51:34 2008
@@ -29,10 +29,7 @@
        exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/proftpd ]; then
                msg_starting ProFTPD
@@ -42,8 +39,9 @@
        else
                msg_already_running ProFTPD
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/proftpd ]; then
                msg_stopping ProFTPD
@@ -52,18 +50,44 @@
        else
                msg_not_running ProFTPD
        fi
+}
+
+
+condrestart() {
+       if [ -f /var/lock/subsys/proftpd ]; then
+               stop
+               start
+       else
+               msg_not_running proftpd
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
        ;;
   status)
        status proftpd
        exit $?
        ;;
-  restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
-       ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/proftpd.init?r1=1.9&r2=1.10&f=u

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

Reply via email to