updated on Thu Jan 26 12:02:26 UTC 2012
[aur-mirror.git] / hal-git / hal
blob012d456ed592bb9c6db046402340afb878ad6102
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 case "$1" in
8 start)
9 #Check for running dbus, start when not running
10 ck_daemon dbus && /etc/rc.d/dbus start
11 if [ -x /etc/rc.d/acpid ]; then
12 ck_daemon acpid && /etc/rc.d/acpid start
14 stat_busy "Starting Hardware Abstraction Layer"
15 if [ ! -x /var/cache/hald ] ; then
16 install -m755 -g 82 -o 82 -d /var/cache/hald
18 if [ ! -x /var/run/hald ]; then
19 install -m755 -g 82 -o 82 -d /var/run/hald
21 if [ ! -x /var/run/hald/hald-local ]; then
22 install -m755 -g 0 -o 0 -d /var/run/hald/hald-local
24 if [ ! -x /var/run/hald/hald-runner ]; then
25 install -m755 -g 0 -o 0 -d /var/run/hald/hald-runner
27 /usr/sbin/hald
28 if [ $? -gt 0 ]; then
29 stat_fail
30 else
31 add_daemon hal
32 stat_done
35 stop)
36 stat_busy "Stopping Hardware Abstraction Layer"
37 [ -f /var/run/hald.pid ] && kill `cat /var/run/hald.pid` &> /dev/null
38 if [ $? -gt 0 ]; then
39 stat_fail
40 else
41 rm_daemon hal
42 stat_done
45 restart)
46 $0 stop
47 sleep 1
48 $0 start
51 echo "usage: $0 {start|stop|restart}"
53 esac
54 exit 0