]> git.pld-linux.org Git - packages/net-snmp.git/commitdiff
- fixed force-reload, added try-restart
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 4 Nov 2008 22:08:15 +0000 (22:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    net-snmptrapd.init -> 1.10

net-snmptrapd.init

index 476867c3f57fce0223cd26e988b2ef3c9176c227..eb97ffd58c6a4cdfd22b8d6bf6cb2b0f90fbd504 100644 (file)
@@ -55,6 +55,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/snmptrapd ]; then
+               stop
+               start
+       else
+               msg_not_running "snmptrapd"
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -64,16 +74,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status snmptrapd
        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.105051 seconds and 4 git commands to generate.