diff options
Diffstat (limited to 'testing/ossp/osspd.rc.d')
-rwxr-xr-x | testing/ossp/osspd.rc.d | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/testing/ossp/osspd.rc.d b/testing/ossp/osspd.rc.d new file mode 100755 index 000000000..c5fabf855 --- /dev/null +++ b/testing/ossp/osspd.rc.d @@ -0,0 +1,52 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/osspd + + +if [[ -z "$DSP_SLAVE" ]]; then + # Autodetect + if [[ -x /usr/bin/pulseaudio ]]; then + DSP_SLAVE="/usr/sbin/ossp-padsp" + else + DSP_SLAVE="/usr/sbin/ossp-alsap" + fi +fi + +PID=`pidof -o %PPID /usr/sbin/osspd` +case "$1" in + start) + stat_busy "Starting OSS userspace bridge" + if [ -z "$PID" ]; then + /sbin/modprobe cuse &>/dev/null + /sbin/udevadm settle --quiet + /usr/sbin/osspd --dsp-slave="$DSP_SLAVE" + fi + if [ -n "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon osspd + stat_done + fi + ;; + stop) + stat_busy "Stopping OSS userspace bridge" + [ -n "$PID" ] && kill $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon osspd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac + +# vim:set ft=sh: |