summaryrefslogtreecommitdiff
path: root/source/n/bluez/config/rc.bluetooth
blob: 296c4542225526bbf239067a6708ad5a33c26e8f (plain)
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
#!/bin/sh

bluez_start() {
  /usr/sbin/bluetoothd
}

bluez_stop() {
  udevadm trigger --subsystem-match=bluetooth --action=remove
  pkill -TERM bluetoothd 1>/dev/null 2>/dev/null
}

case "$1" in
  start)
    bluez_start
    ;;
  stop)
    bluez_stop
    ;;
  restart)
    bluez_stop
    sleep 1
    bluez_start
    ;;
  *)
    printf "Usage: $N {start|stop|restart}\n"
    exit 1
    ;;
esac