]>
Commit | Line | Data |
---|---|---|
e3886206 | 1 | #!/bin/sh |
2 | # | |
3 | # etad This shell script takes care of starting and stopping | |
4 | # etad (ETA UPS daemon). | |
5 | # | |
6 | # chkconfig: 2345 10 99 | |
7 | # | |
8 | # description: etad is the print daemon required for etad to work properly. \ | |
9 | # It is basically a server that monitor your UPS. | |
10 | # | |
11 | # processname: etad | |
12 | # config: /etc/sysconfig/etad | |
13 | ||
14 | ||
15 | # Source function library | |
16 | . /etc/rc.d/init.d/functions | |
17 | ||
18 | # Get network config | |
19 | . /etc/sysconfig/network | |
20 | ||
21 | # Get service config | |
22 | [ -f /etc/sysconfig/etad ] && . /etc/sysconfig/etad | |
23 | ||
24 | ||
25 | # See how we were called. | |
26 | case "$1" in | |
27 | start) | |
28 | # Check if the service is already running? | |
29 | if [ ! -f /var/lock/subsys/etad ]; then | |
30 | msg_starting etad | |
31 | daemon etad $PORT | |
32 | RETVAL=$? | |
33 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/etad | |
34 | else | |
35 | msg_Already_Running Lpd | |
36 | exit 1 | |
37 | fi | |
38 | ;; | |
39 | stop) | |
40 | # Stop daemons. | |
41 | if [ -f /var/lock/subsys/etad ]; then | |
42 | msg_stopping Etad | |
43 | killproc etad | |
44 | rm -f /var/lock/subsys/etad >/dev/null 2>&1 | |
45 | else | |
46 | msg_Not_Running etad | |
47 | exit 1 | |
48 | fi | |
49 | ;; | |
50 | status) | |
51 | status etad | |
52 | exit $? | |
53 | ;; | |
54 | restart) | |
55 | $0 stop | |
56 | $0 start | |
57 | ;; | |
58 | *) | |
59 | msg_Usage "$0 {start|stop|status|restart}" | |
60 | exit 1 | |
61 | esac | |
62 | ||
63 | exit $RETVAL |