X-Git-Url: http://git.pld-linux.org/?p=packages%2FPowerChutePlus.git;a=blobdiff_plain;f=upsd.init;fp=upsd.init;h=e3b3e9002bad67b314509d1b2fdf03d5bcf31675;hp=9fbca2c57366da69dbe77e6f203d5884cd197914;hb=2f9b1e083a836a6a64f593dde89e5a04283503d8;hpb=f48c0a1aa00e5737fa48d30112d42fea552cf4b4 diff --git a/upsd.init b/upsd.init index 9fbca2c..e3b3e90 100644 --- a/upsd.init +++ b/upsd.init @@ -9,8 +9,8 @@ # msamson 04Oct99 Incorporated standard init fixes from Redhat # (pjones@redhat.com) # -# chkconfig: 2345 98 92 -# description: Uninterruptable Power Supply Monitoring Daemon +# chkconfig: 2345 98 92 +# description: Uninterruptable Power Supply Monitoring Daemon # # @@ -32,6 +32,7 @@ if [ -r /upsoff.cmd ]; then rm -f /upsoff.cmd fi + # See how we were called. case "$1" in start) @@ -41,11 +42,9 @@ case "$1" in cd $PWRCHUTE daemon upsd RETVAL=$? - if [ $RETVAL -eq 0 ]; then - touch /var/lock/subsys/upsd - fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/upsd else - msg_Already_Running UPSd + msg_already_running UPSd exit 1 fi ;; @@ -55,21 +54,25 @@ case "$1" in killproc upsd rm -f /var/lock/subsys/upsd >/dev/null 2>&1 else - msg_Not_Running UPSd + msg_not_running UPSd exit 1 fi ;; status) status upsd ;; - reload|force-reload|restart) + restart|reload) $0 stop $0 start exit $? ;; + force-reload) + $0 stop && $0 start + exit $? + ;; *) - msg_Usage "$0 {start|stop|status|restart|reload|force-reload}" - exit 1 + msg_usage "$0 {start|stop|restart|reload|force-reload|status}" + exit 1 ;; esac