[Feature][T8TSK-202][wifi] modify start scirpts

Change-Id: I886ed9cd2600cd7929624c0e03ecc5b37b80e82f
diff --git a/src/lynq/lib/liblynq-wifi6/scripts/start_stop_ap.sh b/src/lynq/lib/liblynq-wifi6/scripts/start_stop_ap.sh
index 8fe91f7..cbf3e4c 100755
--- a/src/lynq/lib/liblynq-wifi6/scripts/start_stop_ap.sh
+++ b/src/lynq/lib/liblynq-wifi6/scripts/start_stop_ap.sh
@@ -12,13 +12,13 @@
 	echo "bind-interfaces"  >> /run/wg870/dnsmasq.conf
 	echo "localise-queries" >> /run/wg870/dnsmasq.conf
 	echo "dhcp-range=192.168.15.2,192.168.15.14,255.255.255.240,1h"  >> /run/wg870/dnsmasq.conf
-	ps -ef | grep "/usr/bin/dnsmasq" | grep "/run/wg870/dnsmasq.conf"
+	ps -eo "%p %a" | grep "/usr/bin/dnsmasq -x /run/wg870/dnsmasq.pid" | grep -v grep
 	if [ $? != 0 ]; then
 		/usr/bin/dnsmasq -x /run/wg870/dnsmasq.pid -7 /run/wg870/dnsmasq.d --local-service -C /run/wg870/dnsmasq.conf -r /run/wg870
 	fi
 
 elif [ "$1" == "stop" ]; then
-	ps -ef | grep "/usr/bin/dnsmasq" | grep "/run/wg870/dnsmasq.conf" | awk '{print $2}' | xargs kill
+	ps -eo "%p %a" | grep "/usr/bin/dnsmasq -x /run/wg870/dnsmasq.pid" | grep -v grep | awk '{print "kill "$1}' | sh
 	ifconfig ap0 down
 	if [ $? != 0 ]; then
 		exit 1
@@ -26,3 +26,5 @@
 else
 	exit 2
 fi
+
+exit 0
diff --git a/src/lynq/lib/liblynq-wifi6/scripts/start_stop_sta.sh b/src/lynq/lib/liblynq-wifi6/scripts/start_stop_sta.sh
index 5f33520..d04e04c 100755
--- a/src/lynq/lib/liblynq-wifi6/scripts/start_stop_sta.sh
+++ b/src/lynq/lib/liblynq-wifi6/scripts/start_stop_sta.sh
@@ -5,12 +5,12 @@
         if [ $? != 0 ]; then
                 exit 1
         fi
-		ps -ef | grep "dhcpcd wlan0" | grep -v grep
+		ps -eo "%p %a" | grep "dhcpcd wlan0" | grep -v grep
 		if [ $? != 0 ];	then
 			dhcpcd wlan0 -t 0 -o domain_name_servers --noipv4ll -B -G &
 		fi
 elif [ "$1" == "stop" ]; then
-        ps -ef | grep "dhcpcd wlan0" | grep -v grep | awk '{print $2}' | xargs kill
+        ps -eo "%p %a" | grep "dhcpcd wlan0" | grep -v grep | awk '{print "kill "$1}' | sh
         ifconfig wlan0 0.0.0.0
         if [ $? != 0 ]; then
                 exit 1
@@ -19,3 +19,4 @@
         exit 2
 fi
 
+exit 0
diff --git a/src/lynq/lib/liblynq-wifi6/scripts/start_wg870_service.sh b/src/lynq/lib/liblynq-wifi6/scripts/start_wg870_service.sh
index 18e3d57..fae9b34 100755
--- a/src/lynq/lib/liblynq-wifi6/scripts/start_wg870_service.sh
+++ b/src/lynq/lib/liblynq-wifi6/scripts/start_wg870_service.sh
@@ -39,6 +39,7 @@
         if [ "$state" != "OK" ]; then
                 exit 2
         fi
+		wpa_cli -iwpa_wlan0_cmd -p/var/run/ IFNAME=wlan0 disconnect
 fi
 
 state=`wpa_cli -iwpa_wlan0_cmd -p/var/run/ interface | grep -vE "Available|p2p-dev" | grep ap0`