]> git.pld-linux.org Git - packages/cancd.git/commitdiff
- add try-restart, correct force-reload AC-branch auto/ac/cancd-0_1_0-1
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 29 Sep 2008 13:03:40 +0000 (13:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cancd.init -> 1.5

cancd.init

index e81b7b6e96137562cb98108c7748644426491b15..3ff36e573bdb40a8153b4d87f2e0fddbd99e67c7 100644 (file)
@@ -51,6 +51,16 @@ stop() {
        fi
 }
 
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/cancd ]; then
+               stop
+               start
+       else
+               msg_not_running cancd
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -60,16 +70,22 @@ case "$1" in
   stop)
        stop
        ;;
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status cancd
        RETVAL=$?
        ;;
   *)
   status)
        status cancd
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
        exit 3
 esac
 
This page took 0.090298 seconds and 4 git commands to generate.