initial
[wilink8-wlan/wl18xx-target-scripts.git] / ap / ap_stop.sh
1 #!/system/bin/sh
3 INSMOD=/system/bin/insmod
4 RMMOD=/system/bin/rmmod
5 IFCONFIG=/system/bin/ifconfig
6 HOSTAPD_CLI=/system/bin/wpa_cli
8 WLAN_IF=wlan1
10 SERVICE_HOSTAPD=hostapd_bin
12 HOSTAPD_STAT=`getprop init.svc.$SERVICE_HOSTAPD`
13 echo "hostapd state: $HOSTAPD_STAT"
14 if [ ! "$HOSTAPD_STAT" == "running" ] ; then echo "hostapd is not in running state, exiting..." ; exit 0 ; fi
16 echo "kill udhcpd"
17 killall udhcpd
19 echo "unload hostapd"
20 setprop ctl.stop $SERVICE_HOSTAPD
21 #$WPA_CLI -i$WLAN_IF -p/data/misc/wifi/wlan0 terminate
22 sleep 1
24 echo "disable interface"
25 $IFCONFIG $WLAN_IF down
26 sleep 1
28 echo "unload driver"
29 $RMMOD wl12xx_sdio
30 sleep 1