blob: eb0cfbd6119d0dab12c63a4b7066b1f51f5cdaca (
plain)
1 #!/bin/sh
2 #@ bluez-alsa startup script.
3 #@ Likely requires <- bluetoothd [<- dbus]
4
5 RD=/run
6 PID=${RD}/bluealsa.pid
7
8 SSD=/sbin/start-stop-daemon
9 PROG=/usr/bin/bluealsa
10 OPTS=-S
11
12 case "${1}" in
13 start)
14 exec "${SSD}" --start --background --make-pidfile --pidfile "${PID}" \
15 --exec "${PROG}" -- ${OPTS}
16 ;;
17 stop)
18 exec "${SSD}" --stop --remove-pidfile --retry 10 --pidfile "${PID}" \
19 --exec "${PROG}"
20 ;;
21 restart)
22 "${SSD}" --status --pidfile "${PID}" --exec "${PROG}" && "${0}" stop
23 exec "${0}" start
24 ;;
25 status)
26 "${SSD}" --status --pidfile "${PID}" --exec "${PROG}"
27 e=${?}
28 case ${e} in
29 0) echo "${PROG} is running with pid $(cat ${PID})";;
30 1) echo "${PROG} is not running but the pid file ${PID} exists";;
31 3) echo "${PROG} is not running";;
32 4) echo "Unable to determine the program status";;
33 esac
34 exit ${e}
35 ;;
36 *)
37 echo "usage: ${0} start|stop|restart|status"
38 ;;
39 esac
|