xref: /OK3568_Linux_fs/buildroot/board/forlinx/ok3568/fs-overlay/etc/init.d/S97BT (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#! /bin/sh
2NUM=`ifconfig -a | grep mlan0`
3if [ "$NUM" = "" ]; then
4    exit 1
5fi
6
7[ -f /usr/libexec/bluetooth/bluetoothd ] || exit 0
8[ -f /usr/libexec/bluetooth/obexd ] || exit 0
9
10case "$1" in
11    start)
12        export DBUS_SESSION_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
13		hciattach /dev/ttyS8 any -s 115200 115200 flow > /dev/null
14		hciconfig hci0 up
15        /usr/libexec/bluetooth/bluetoothd &
16        /usr/libexec/bluetooth/obexd -a -r /root &
17        ;;
18    stop)
19        killall bluetoothd
20        killall obexd
21		hciconfig hci0 down
22		killall hciattach
23        ;;
24    restart|reload)
25        $0 stop
26        $0 start
27        ;;
28    *)
29        echo "Usage: $0 {start|stop|restart}"
30        exit 1
31esac
32
33