]> git.pld-linux.org Git - packages/nut.git/blob - nut-upsmon.init
- fixed multi-line descriptions
[packages/nut.git] / nut-upsmon.init
1 #!/bin/sh
2 #
3 # upsmon        NUT daemon monitoring tool
4 #
5 # chkconfig:    2345 10 90
6 #
7 # description:  upsmon talks to upsd and notifies of ups status changes, \
8 #               also shutting systems down if required.
9 # processname:  upsmon
10 # config:       /etc/ups/
11
12 # Source function library.
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get config.
19 [ -f /etc/sysconfig/upsmon ] && . /etc/sysconfig/upsmon
20
21 RETVAL=0
22 # See how we are called.
23 case "$1" in
24   start)
25         # Check if the service is already running?
26         if [ ! -f /var/lock/subsys/upsmon ]; then
27                 msg_starting "UPSmon"
28                 daemon upsmon
29                 RETVAL=$?
30                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/upsmon
31         else
32                 msg_already_running "UPSmon"
33         fi
34         ;;
35   stop)
36         if [ -f /var/lock/subsys/upsmon ]; then
37                 msg_stopping "UPSmon"
38                 killproc upsmon
39                 rm -f /var/lock/subsys/upsmon
40         else
41                 msg_not_running "UPSmon"
42         fi
43         ;;
44   restart|force-reload)
45         $0 stop
46         $0 start
47         exit $?
48         ;;
49   status)
50         status upsmon
51         exit $?
52         ;;
53   *)
54         msg_usage "$0 {start|stop|restart|force-reload|status}"
55         exit 3
56 esac 
57
58 exit $RETVAL
This page took 0.030006 seconds and 4 git commands to generate.