a7b6071e98e494fc0252bd6ed1b5a671de6a8e43
[platform/core/connectivity/bluetooth-tools.git] / scripts / etc / bt-stack-down.sh
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3 PGREP=/usr/bin/pgrep
4
5 #
6 # Script for stopping Bluetooth stack
7 #
8
9 # Remove BT device
10 /usr/etc/bluetooth/bt-dev-end.sh
11
12 # Kill BlueZ bluetooth stack
13
14 BLUETOOTH_PID=$($PGREP bluetooth)
15 if [ "$BLUETOOTH_PID" != "" ]; then
16         kill $BLUETOOTH_PID
17 fi
18
19 OBEXD_PID=$($PGREP obexd)
20 if [ "$OBEXD_PID" != "" ]; then
21         kill $OBEXD_PID
22 fi
23
24 OBEXDCLIENT_PID=$($PGREP obexd-client)
25 if [ "$OBEXDCLIENT_PID" != "" ]; then
26         kill $OBEXDCLIENT_PID
27 fi
28
29 BTSHARE_PID=$($PGREP bluetooth-share)
30 if [ "$BTSHARE_PID" != "" ]; then
31         kill $BTSHARE_PID
32 fi
33
34 BTPB_AGENT_PID=$($PGREP bluetooth-pb-agent)
35 if [ "$BTPB_AGENT_PID" != "" ]; then
36         kill $BTPB_AGENT_PID
37 fi
38
39 BTMAP_AGENT_PID=$($PGREP bluetooth-map-agent)
40 if [ "$BTMAP_AGENT_PID" != "" ]; then
41         kill $BTMAP_AGENT_PID
42 fi
43
44 BTHFP_AGENT_PID=$($PGREP bluetooth-hfp-agent)
45 if [ "$BTHFP_AGENT_PID" != "" ]; then
46         kill $BTHFP_AGENT_PID
47 fi
48
49 BLUETOOTHD_PID=$($PGREP bluetoothd)
50 if [ "$BLUETOOTHD_PID" != "" ]; then
51         kill $BLUETOOTHD_PID
52 fi
53
54
55 # result
56 exit 0