summaryrefslogtreecommitdiffstats
path: root/cdemu-daemon/cdemud.rc
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-06-18 19:18:48 +0200
committerFlorian Pritz <f-p@gmx.at>2009-06-18 19:18:48 +0200
commit488d3624be68a1655fc8b40241f514e52855d18b (patch)
tree92b5edbd9e5193c188cca3dd7b6e92ae562312b3 /cdemu-daemon/cdemud.rc
parentf15be7756cf924b6b116655846804d45d971581e (diff)
downloadaur-packages-488d3624be68a1655fc8b40241f514e52855d18b.tar.gz
aur-packages-488d3624be68a1655fc8b40241f514e52855d18b.tar.xz
update
Diffstat (limited to 'cdemu-daemon/cdemud.rc')
-rw-r--r--cdemu-daemon/cdemud.rc55
1 files changed, 55 insertions, 0 deletions
diff --git a/cdemu-daemon/cdemud.rc b/cdemu-daemon/cdemud.rc
new file mode 100644
index 0000000..f76ba42
--- /dev/null
+++ b/cdemu-daemon/cdemud.rc
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/cdemud
+
+case "$1" in
+ start)
+ stat_busy "Loading vhba module"
+ modprobe vhba
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+
+ stat_busy "Waiting for $CTL_DEVICE"
+ i=0
+ until [ -c $CTL_DEVICE -o $i -ge 10 ]; do
+ i=`expr $i + 1`
+ sleep 1
+ done
+ if [ -c $CTL_DEVICE ]; then
+ stat_done
+ else
+ stat_fail
+ fi
+
+ stat_busy "Starting cdemud"
+ cdemud -d -n $NUM_DRIVES -c $CTL_DEVICE -a $AUDIO_BACKEND &>/dev/null
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ add_daemon cdemud
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping cdemud"
+ cdemud -k &>/dev/null
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ rm_daemon cdemud
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac