- added try-restart
authorJakub Bogusz <qboosh@pld-linux.org>
Thu, 25 Dec 2008 10:46:31 +0000 (10:46 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dahdi.init -> 1.2

dahdi.init

index 8377f7c..d7d67c1 100644 (file)
@@ -49,6 +49,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/dahdi ]; then
+               stop
+               start
+       else
+               msg_not_running dahdi
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -58,13 +68,13 @@ case "$1" in
   stop)
        stop
        ;;
-  status)
-       RETVAL=0
-       ;;
   restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
   reload|force-reload|graceful)
        if [ -f /var/lock/subsys/dahdi ]; then
                /sbin/ztcfg
@@ -74,8 +84,11 @@ case "$1" in
                RETVAL=7
        fi
        ;;
+  status)
+       RETVAL=0
+       ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|graceful|status}"
        exit 3
        ;;
 esac
This page took 0.042328 seconds and 4 git commands to generate.