updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / ivman / ivman.rc
blob737b37df93d6e0d46fd30038305fdf13ce188c1c
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 PID=`pidof -o %PPID /usr/bin/ivman`
8 case "$1" in
9 start)
10 stat_busy "Starting ivman Device Manager"
11 if [ -z "$PID" ]; then
12 if [ ! -f /etc/ivman/IvmConfigBase.xml ]; then
13 echo "ERROR: Make sure '/etc/ivman/IvmConfigBase.xml' exists"
14 stat_fail
15 exit 1
17 /usr/bin/ivman > /dev/null
19 if [ ! -f /var/run/daemons/hal ]; then
20 stat_fail
21 echo "ERROR: 'hal' is not running"
22 if [ ! -f /var/run/daemons/dbus ]; then
23 echo "NOTE: 'hal' needs 'dbus' to be running - you need to start both!"
25 exit 1
27 if [ ! -z "$PID" -o $? -gt 0 ]; then
28 stat_fail
29 else
30 add_daemon ivman
31 stat_done
34 stop)
35 stat_busy "Stopping ivman Device Manager"
36 [ ! -z "$PID" ] && kill $PID &> /dev/null
37 if [ $? -gt 0 ]; then
38 stat_fail
39 else
40 rm_daemon ivman
41 stat_done
44 restart)
45 $0 stop
46 sleep 1
47 $0 start
50 echo "usage: $0 {start|stop|restart}"
52 esac
53 exit 0