2009-08-26 17:00:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Start/stop/restart acpid.
|
|
|
|
|
|
|
|
# Start acpid:
|
|
|
|
acpid_start() {
|
|
|
|
if [ -x /usr/sbin/acpid -a -d /proc/acpi ]; then
|
|
|
|
echo "Starting ACPI daemon: /usr/sbin/acpid"
|
|
|
|
/usr/sbin/acpid
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Stop acpid:
|
|
|
|
acpid_stop() {
|
2010-05-19 10:58:23 +02:00
|
|
|
if [ -r /var/run/acpid.pid ]; then
|
|
|
|
kill $(cat /var/run/acpid.pid)
|
|
|
|
else
|
|
|
|
killall acpid
|
|
|
|
fi
|
2009-08-26 17:00:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Restart acpid:
|
|
|
|
acpid_restart() {
|
|
|
|
acpid_stop
|
|
|
|
sleep 1
|
|
|
|
acpid_start
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
'start')
|
|
|
|
acpid_start
|
|
|
|
;;
|
|
|
|
'stop')
|
|
|
|
acpid_stop
|
|
|
|
;;
|
|
|
|
'restart')
|
|
|
|
acpid_restart
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage $0 start|stop|restart"
|
|
|
|
esac
|