[Bugfix][API-1022] fix run script fail when start sta first after reboot
[Bugfix][API-1039] fix can't get dns

Change-Id: If3f8cb0b68f143bf9d20c20807ab052340fe8a53
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 259aa01..25dd644 100755
--- a/src/lynq/lib/liblynq-wifi6/scripts/start_stop_ap.sh
+++ b/src/lynq/lib/liblynq-wifi6/scripts/start_stop_ap.sh
@@ -7,16 +7,20 @@
 		exit 1
 	fi
 	mkdir -p /run/wg870/dnsmasq.d
-	echo "port=0" > /run/wg870/dnsmasq.conf
-	echo "interface=ap0" >> /run/wg870/dnsmasq.conf
-	echo "listen-address=192.168.15.1" >> /run/wg870/dnsmasq.conf
-	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
-	echo "dhcp-leasefile=/run/wg870/ap0.lease" >> /run/wg870/dnsmasq.conf
-	ps -eo "%p %a" | grep "/usr/bin/dnsmasq -x /run/wg870/dnsmasq.pid" | grep -v grep
+	conf_file="/run/wg870/dnsmasq.conf"
+	echo "port=0" > $conf_file
+	echo "interface=ap0" >> $conf_file
+	echo "listen-address=192.168.15.1" >> $conf_file
+	echo "bind-interfaces"  >> $conf_file
+	echo "localise-queries" >> $conf_file
+	echo "dhcp-range=192.168.15.2,192.168.15.14,255.255.255.240,1h"  >> $conf_file
+	echo "dhcp-option=3,192.168.15.1"  >> $conf_file
+	echo "dhcp-option=6,192.168.15.1"  >> $conf_file
+	echo "dhcp-range=192.168.15.2,192.168.15.14,255.255.255.240,1h"  >> $conf_file
+	echo "dhcp-leasefile=/run/wg870/ap0.lease" >> $conf_file
+	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
+		/usr/bin/dnsmasq -x /run/wg870/dnsmasq.pid -7 /run/wg870/dnsmasq.d --local-service -C $conf_file -r /run/wg870
 	fi
 
 elif [ "$1" == "stop" ]; then