updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / acpi-support / acpi-support
blob00402b6919e23ced7f1467d900bba0802e087942
1 #!/bin/bash
2 # INIT script to check whether we're on batteries, and so start with laptop
3 # mode etc enabled.
5 # BUGS: unless we start *really* late, we have no way of throttling
6 # xscreensaver, since it won't be there to command.
7 . /etc/rc.conf
8 . /etc/rc.d/functions
9 . /usr/share/acpi-support/power-funcs
11 #test -f /lib/lsb/init-functions ||exit 1
12 #. /lib/lsb/init-functions
14 test -d /var/lib/acpi-support || exit 0
16 shopt -s nullglob
18 case "$1" in
19 start)
20 stat_busy "Checking battery state..."
21 /etc/acpi/power.sh
22 # Source everything in /etc/acpi/start.d/
23 for SCRIPT in /etc/acpi/start.d/*.sh; do
24 . $SCRIPT
25 done
26 stat_done
28 stop)
29 stat_busy "Disabling power management..."
30 /etc/acpi/power.sh stop
31 stat_done
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
39 echo "usage: $0 {start|stop|restart}"
40 esac
41 exit 0