]>
Commit | Line | Data |
---|---|---|
f9c30b1d | 1 | #!/bin/sh |
2 | # $Id$ | |
3 | # | |
4 | # pmud Power Manager daemon for Apple powerbooks | |
5 | # | |
6 | # chkconfig: 2345 40 60 | |
7 | # description: pmud is a daemon which periodically polls the PMU \ | |
8 | # (power manager) and performs functions such as enabling \ | |
9 | # or disabling devices appropriately when the power source \ | |
10 | # changes. | |
11 | # | |
12 | # config: /etc/sysconfig/power | |
13 | ||
14 | # Source function library | |
15 | . /etc/rc.d/init.d/functions | |
16 | ||
17 | # Get service config | |
18 | if [ -f /etc/sysconfig/pmud ]; then | |
19 | . /etc/sysconfig/pmud | |
20 | fi | |
21 | ||
22 | RETVAL=0 | |
23 | # See how we were called. | |
24 | case "$1" in | |
25 | start) | |
26 | # Check if service is already running? | |
27 | if [ ! -f /var/lock/subsys/pmud ]; then | |
f9c30b1d | 28 | # try load event module |
29 | msg_starting "pmud" | |
30 | daemon pmud $PMUD_FLAGS | |
31 | RETVAL=$? | |
32 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pmud | |
33 | else | |
34 | msg_already_running "pmud" | |
35 | fi | |
36 | ;; | |
37 | stop) | |
38 | if [ -f /var/lock/subsys/pmud ]; then | |
39 | msg_stopping "pmud" | |
40 | killproc pmud | |
41 | rm -f /var/lock/subsys/pmud | |
42 | else | |
43 | msg_not_running pmud | |
44 | fi | |
45 | ;; | |
46 | status) | |
47 | status pmud | |
48 | exit $? | |
49 | ;; | |
50 | restart|force-reload) | |
51 | $0 stop | |
52 | $0 start | |
53 | exit $? | |
54 | ;; | |
55 | *) | |
56 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
57 | exit 3 | |
58 | esac | |
59 | ||
60 | exit $RETVAL |