]> git.pld-linux.org Git - packages/openct.git/commitdiff
- added try-restart and force-reload
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 17 Nov 2008 16:59:33 +0000 (16:59 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- removed reload (only restart possible)

Changed files:
    openct.init -> 1.2

openct.init

index 24ed37e6fb486b3889db20d55d9568addd9a7581..e5396c5175d686891739b5b9b57a73c6de50510e 100644 (file)
@@ -9,11 +9,7 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-       # Check if the service is already running?
+start() {
        if [ ! -f /var/lock/subsys/openct ]; then
                show "Initializing OpenCT status"
                busy
@@ -28,9 +24,9 @@ case "$1" in
        else
                msg_already_running openct
        fi
-       ;;
-  stop)
-       # Stop daemons.
+}
+
+stop() {
        if [ -f /var/lock/subsys/openct ]; then
                show "Shutting down OpenCT"
                busy
@@ -40,21 +36,43 @@ case "$1" in
        else
                msg_not_running openct
        fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/openct ]; then
+               stop
+               start
+       else
+               msg_not_running openct
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
        ;;
-  status)
-       status openct
-       RETVAL=$?
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
        ;;
-  reload)
-       $0 restart
+  status)
+       status openct
+       RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
        ;;
 esac
This page took 0.224007 seconds and 4 git commands to generate.