]> git.pld-linux.org Git - packages/apmd.git/blame - apmd.init
- mass commit: cosmetics (removed trailing white spaces)
[packages/apmd.git] / apmd.init
CommitLineData
21fdd835
JR
1#!/bin/sh
2#
8fa4b1e9 3# chkconfig: 2345 35 65
e388a5d6
JR
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
21fdd835 9
21fdd835
JR
10# Source function library.
11. /etc/rc.d/init.d/functions
12
07e7376a 13if [ ! -f /proc/apm ]; then
aebeada1 14 modprobe apm && echo $(nls "No kernel APM support")'!'; exit 1
07e7376a 15fi
16
17CONFIG=/etc/sysconfig/apmd
18
21fdd835
JR
19# See how we were called.
20case "$1" in
21 start)
b71944ee 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
b71944ee 30 fi
21fdd835
JR
31 ;;
32 stop)
b71944ee 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
b71944ee 39 fi
21fdd835
JR
40 ;;
41 status)
42 status apmd
02dd71d9 43 exit $?
21fdd835 44 ;;
02dd71d9 45 restart|force-reload)
21fdd835
JR
46 $0 stop
47 $0 start
02dd71d9 48 exit $?
21fdd835 49 ;;
21fdd835 50 *)
02dd71d9 51 msg_usage "$0 {start|stop|restart|force-reload|status}"
52 exit 3
21fdd835 53esac
This page took 0.02955 seconds and 4 git commands to generate.