015d351352a648e310a5e99a7fefb6e7c6b4c613
[platform/core/connectivity/bluetooth-tools.git] / scripts / mobile / bt-stack-up.sh
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3
4 #
5 # Script for executing Bluetooth stack
6 #
7
8 # Start HCI logging
9 systemctl start bluetooth-hci-logger.service
10
11 # Register BT Device
12 /usr/etc/bluetooth/bt-dev-start.sh
13
14 if !(/usr/bin/hciconfig | grep hci); then
15         echo "Registering BT device is failed."
16         systemctl stop bluetooth-hci-logger.service
17         exit 1
18 fi
19
20 # Execute BlueZ BT stack
21 echo "Run bluetoothd"
22 /usr/libexec/bluetooth/bluetoothd -d -C &
23
24 echo "Run bluetooth-share by systemd"
25 systemctl start --no-block bluetooth-share.service
26
27 exit 0