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