Use the kill command instead of killall
[platform/core/connectivity/bluetooth-tools.git] / scripts / mobile / 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 # Stop HCI logging
13 /usr/bin/touch /run/.hci_logger_stop
14
15 # Kill BlueZ bluetooth stack
16
17 OBEXD_PID=$($PGREP obexd)
18 if [ "$OBEXD_PID" != "" ]; then
19         kill $OBEXD_PID
20 fi
21
22 OBEXDCLIENT_PID=$($PGREP obexd-client)
23 if [ "$OBEXDCLIENT_PID" != "" ]; then
24         kill $OBEXDCLIENT_PID
25 fi
26
27 BTSYSPOPUP_PID=$($PGREP bt-syspopup)
28 if [ "BTSYSPOPUP_PID" != "" ]; then
29         kill BTSYSPOPUP_PID
30 fi
31
32 BTSHARE_PID=$($PGREP bluetooth-share)
33 if [ "$BTSHARE_PID" != "" ]; then
34         kill $BTSHARE_PID
35 fi
36
37 BTPB_AGENT_PID=$($PGREP bluetooth-pb-agent)
38 if [ "$BTPB_AGENT_PID" != "" ]; then
39         kill $BTPB_AGENT_PID
40 fi
41
42 BTMAP_AGENT_PID=$($PGREP bluetooth-map-agent)
43 if [ "$BTMAP_AGENT_PID" != "" ]; then
44         kill $BTMAP_AGENT_PID
45 fi
46
47 BTHFP_AGENT_PID=$($PGREP bluetooth-hfp-agent)
48 if [ "$BTHFP_AGENT_PID" != "" ]; then
49         kill $BTHFP_AGENT_PID
50 fi
51
52 BTAG_AGENT_PID=$($PGREP bluetooth-ag-agent)
53 if [ "$BTAG_AGENT_PID" != "" ]; then
54         kill $BTAG_AGENT_PID
55 fi
56
57 BLUETOOTHD_PID=$($PGREP bluetoothd)
58 if [ "$BLUETOOTHD_PID" != "" ]; then
59         kill $BLUETOOTHD_PID
60 fi
61
62 # result
63 exit 0