-
Notifications
You must be signed in to change notification settings - Fork 0
/
bluealsa
executable file
·58 lines (50 loc) · 1.17 KB
/
bluealsa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
### BEGIN INIT INFO
# Provides: bluealsa
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Required-Start: dbus $syslog $local_fs $remote_fs bluetooth
# Required-Stop: dbus $syslog $local_fs $remote_fs
# Short-Description: Bluealsa daemon
### END INIT INFO
. /lib/lsb/init-functions
NAME=bluealsa
DESC="Bluealsa daemon"
DAEMON=/usr/bin/$NAME
PIDFILE="/var/run/$NAME.pid"
COMMON_OPTS="--quiet --oknodo --pidfile $PIDFILE"
BA_OPTS="-p a2dp-source -p a2dp-sink"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -f /etc/default/bluez-alsa ] && . /etc/default/bluez-alsa
start() {
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --background --make-pidfile $COMMON_OPTS \
--exec $DAEMON -- $BA_OPTS $OPTIONS
log_end_msg $?
}
stop() {
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop $COMMON_OPTS --exec $DAEMON
log_end_msg $?
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
stop
start
;;
status)
status_of_proc -p $PIDFILE $DAEMON $NAME
;;
*)
echo "Usage: $0 {start|stop|force-reload|restart|status}"
exit 2
;;
esac