]> git.pld-linux.org Git - packages/laptop-mode-tools.git/commitdiff
- force-reload is not supposed to start service if not running
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 9 Jan 2008 17:14:29 +0000 (17:14 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- added try-restart action

Changed files:
    laptop-mode-tools.init -> 1.4

laptop-mode-tools.init

index e3d8c469cf463fd49f616c7da3373eafeea83ff8..2d4f8a0976f1334cd2c5697bcbff4031925bbc9f 100644 (file)
@@ -30,6 +30,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/laptop-mode-tools ]; then
+               stop
+               start
+       else
+               msg_not_running "laptop mode"
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -39,16 +49,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        /usr/sbin/laptop_mode status
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.824598 seconds and 4 git commands to generate.