From: Hyuk Lee Date: Tue, 5 Sep 2017 01:59:48 +0000 (+0900) Subject: Replace the killall to pgrep X-Git-Tag: accepted/tizen/unified/20180226.142343~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F147559%2F1;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-tools.git Replace the killall to pgrep Change-Id: Ia37473989d281938a0ec4387b4e9ba8243821888 Signed-off-by: Hyuk Lee --- diff --git a/scripts/etc/bt-stack-down.sh b/scripts/etc/bt-stack-down.sh index 806f50f..d37eabe 100644 --- a/scripts/etc/bt-stack-down.sh +++ b/scripts/etc/bt-stack-down.sh @@ -1,5 +1,6 @@ #!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin +PGREP=/usr/bin/pgrep # # Script for stopping Bluetooth stack @@ -9,13 +10,47 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin /usr/etc/bluetooth/bt-dev-end.sh # Kill BlueZ bluetooth stack -killall bluetooth -killall obexd obex-client -killall bluetooth-share -killall bluetooth-pb-agent -killall bluetooth-map-agent -killall bluetooth-hfp-agent -killall bluetoothd + +if ($PGREP bluetooth); then + BLUETOOTH_PID=$($PGREP bluetooth) + kill $BLUETOOTH_PID +fi + +if ($PGREP obexd); then + OBEXD_PID=$($PGREP obexd) + kill $OBEXD_PID +fi + +if ($PGREP obexd-client); then + OBEXDCLIENT_PID=$($PGREP obexd-client) + kill $OBEXDCLIENT_PID +fi + +if ($PGREP bluetooth-share); then + BTSHARE_PID=$($PGREP bluetooth-share) + kill $BTSHARE_PID +fi + +if ($PGREP bluetooth-pb-agent); then + BTPB_AGENT_PID=$($PGREP bluetooth-pb-agent) + kill $BTPB_AGENT_PID +fi + +if ($PGREP bluetooth-map-agent); then + BTMAP_AGENT_PID=$($PGREP bluetooth-map-agent) + kill $BTMAP_AGENT_PID +fi + +if ($PGREP bluetooth-hfp-agent); then + BTHFP_AGENT_PID=$($PGREP bluetooth-hfp-agent) + kill $BTHFP_AGENT_PID +fi + +if ($PGREP bluetoothd); then + BLUETOOTHD_PID=$($PGREP bluetoothd) + kill $BLUETOOTHD_PID +fi + # result exit 0