]> git.pld-linux.org Git - packages/apmd.git/blob - apmd.init
- LSB compliance
[packages/apmd.git] / apmd.init
1 #!/bin/sh
2 #
3 # chkconfig:    2345 35 65
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 # Source function library.
11 . /etc/rc.d/init.d/functions
12
13 if [ ! -f /proc/apm ]; then  
14         modprobe apm && echo $(nls "No kernel APM support")'!'; exit 1
15 fi
16
17 CONFIG=/etc/sysconfig/apmd
18
19 # See how we were called.
20 case "$1" in
21   start)
22         # Check if the service is already running?
23         if [ ! -f /var/lock/subsys/apmd ]; then
24                 msg_starting APM
25                 [ -r "$CONFIG" ] && . "$CONFIG"
26                 daemon apmd "$APMD_OPTIONS"
27                 touch /var/lock/subsys/apmd
28         else
29                 msg_already_running APM
30         fi
31         ;;
32   stop)
33         if [ -f /var/lock/subsys/apmd ]; then
34                 msg_stopping APM
35                 killproc apmd
36                 rm -f /var/lock/subsys/apmd
37         else
38                 msg_not_running APM
39         fi
40         ;;
41   status)
42         status apmd
43         exit $?
44         ;;
45   restart|force-reload)
46         $0 stop
47         $0 start
48         exit $?
49         ;;
50   *)
51         msg_usage "$0 {start|stop|restart|force-reload|status}"
52         exit 3
53 esac
This page took 0.054453 seconds and 4 git commands to generate.