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