]> git.pld-linux.org Git - packages/apmd.git/blob - apmd.init
- cleaning
[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                 exit 1
31         fi
32         ;;
33   stop)
34         if [ -f /var/lock/subsys/apmd ]; then
35                 msg_stopping APM
36                 killproc apmd
37                 rm -f /var/lock/subsys/apmd
38         else
39                 msg_not_running APM
40                 exit 1
41         fi
42         ;;
43   status)
44         status apmd
45         ;;
46   restart|reload)
47         $0 stop
48         $0 start
49         ;;
50   *)
51         msg_usage "$0 {start|stop|restart|reload|status}"
52         exit 1
53 esac
This page took 0.052348 seconds and 4 git commands to generate.