summaryrefslogtreecommitdiff
path: root/source/a/acpid/rc.acpid
blob: 32486d17cadf89b16b938610b0804f910e7e6483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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() {
  killall acpid
}

# 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