X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=net-snmptrapd.init;h=eb97ffd58c6a4cdfd22b8d6bf6cb2b0f90fbd504;hb=824af5133aee7e216f3ad2f2784d5852eeeba0c0;hp=476867c3f57fce0223cd26e988b2ef3c9176c227;hpb=102069000c36ee4961d517e4bde4054f2fed4fde;p=packages%2Fnet-snmp.git diff --git a/net-snmptrapd.init b/net-snmptrapd.init index 476867c..eb97ffd 100644 --- a/net-snmptrapd.init +++ b/net-snmptrapd.init @@ -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