Add the default path in the script file
[platform/core/connectivity/bluetooth-tools.git] / scripts / bt-edutm-dev-up.sh
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3
4 #
5 # Script for turning on Bluetooth (EDUTM)
6 #
7
8 if /usr/bin/hciconfig | /bin/grep hci; then
9         /usr/etc/bluetooth/bt-stack-down.sh
10         /bin/sleep 1
11 fi
12
13 # Register BT Device
14 /usr/etc/bluetooth/bt-dev-start.sh
15
16 if !(/usr/bin/hciconfig | /bin/grep hci); then
17         echo "BT EDUTM failed. Registering BT device is failed."
18         exit 1
19 fi
20
21 # Execute BlueZ BT stack
22 echo "Run bluetoothd"
23 /usr/lib/bluetooth/bluetoothd &
24 /usr/bin/bt-service &
25 /bin/sleep 0.1
26
27 /usr/bin/hciconfig hci0 name TIZEN-Mobile
28
29 /usr/bin/hciconfig hci0 piscan
30
31 if [ -e "/sys/devices/hci0/idle_timeout" ]
32 then
33         echo "Set idle time"
34         echo 0 > /sys/devices/hci0/idle_timeout
35 fi