]>
Commit | Line | Data |
---|---|---|
21fdd835 JR |
1 | #!/bin/sh |
2 | # | |
3 | # chkconfig: 2345 05 92 | |
4 | # description: apmd is used for monitoring batery status and logging it via \ | |
5 | # syslog(8). It can also be used for shutting down the machine when \ | |
6 | # the battery is low. | |
7 | # processname: apmd | |
8 | # config: /etc/sysconfig/apmd | |
9 | ||
10 | CONFIG=/etc/sysconfig/apmd | |
11 | # Source function library. | |
12 | . /etc/rc.d/init.d/functions | |
13 | ||
14 | # See how we were called. | |
15 | case "$1" in | |
16 | start) | |
17 | echo -n "Starting up APM daemon: " | |
18 | test -r "$CONFIG" && . "$CONFIG" | |
19 | daemon /usr/sbin/apmd "$APMD_OPTIONS" | |
20 | touch /var/lock/subsys/apmd | |
21 | echo | |
22 | ;; | |
23 | stop) | |
24 | echo -n "Shutting down APM daemon: " | |
25 | killproc apmd | |
26 | rm -f /var/lock/subsys/apmd | |
27 | echo | |
28 | ;; | |
29 | status) | |
30 | status apmd | |
31 | ;; | |
32 | restart|reload) | |
33 | $0 stop | |
34 | $0 start | |
35 | ;; | |
36 | ||
37 | *) | |
38 | echo "Usage: apmd.init {start|stop|status|restart|reload}" | |
39 | exit 1 | |
40 | esac |