Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #! /bin/sh -e |
| 2 | |
| 3 | test -x /usr/sbin/acpid || exit 0 |
| 4 | test -d /proc/acpi || exit 0 |
| 5 | mkdir -p /etc/acpi/events |
| 6 | |
| 7 | case "$1" in |
| 8 | start) |
| 9 | echo -n "Starting Advanced Configuration and Power Interface daemon: " |
| 10 | if [ ! -d /etc/acpi/events ]; then |
| 11 | echo "There is not any rule configuration file." |
| 12 | else |
| 13 | start-stop-daemon -o -S -x /usr/sbin/acpid -- -c /etc/acpi/events |
| 14 | echo "acpid." |
| 15 | fi |
| 16 | ;; |
| 17 | stop) |
| 18 | echo -n "Stopping Advanced Configuration and Power Interface daemon: " |
| 19 | start-stop-daemon -o -K -x /usr/sbin/acpid |
| 20 | echo "acpid." |
| 21 | ;; |
| 22 | restart|force-reload) |
| 23 | $0 stop |
| 24 | $0 start |
| 25 | ;; |
| 26 | *) |
| 27 | echo "Usage: /etc/init.d/acpid {start|stop|restart|force-reload}" |
| 28 | exit 1 |
| 29 | esac |
| 30 | |
| 31 | exit 0 |