Add the default path in the script file
[platform/core/connectivity/bluetooth-tools.git] / scripts / etc / 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 # Register BT Device
9 /usr/etc/bluetooth/bt-dev-start.sh
10
11 if !(/usr/bin/hciconfig | grep hci); then
12         echo "Registering BT device is failed."
13         exit 1
14 fi
15
16 # We have to handle both systemd and sysvinit cases differently
17 if [ -d /sys/fs/cgroup/systemd ]; then
18    # bt-service changes USER to 'app' via libprivilege-control, so it needs
19    # to know where the session bus is located under systemd
20    export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/app/dbus/user_bus_socket
21 fi
22
23 # Execute BlueZ BT stack
24 echo "Run bluetoothd"
25 /usr/libexec/bluetooth/bluetoothd -d -C &
26 /usr/bin/bluetooth-share &
27
28 exit 0