new/app/qsetting/S80wifireconnect

29 lines
628 B
Plaintext
Raw Permalink Normal View History

2025-05-10 21:58:58 +08:00
#!/bin/sh
#
# Reconnect Wifi...
#
case "$1" in
start)
echo "Trying to reconnect Wifi"
if [ -e /userdata/cfg/wpa_supplicant.conf ];then
if [ -n `grep "ssid=" /userdata/cfg/wpa_supplicant.conf` ];then
if [ -z `grep "SSID" /userdata/cfg/wpa_supplicant.conf` ];then
if [ -n `grep "psk=" /userdata/cfg/wpa_supplicant.conf` ];then
if [ -z `grep "PASSWORD" /userdata/cfg/wpa_supplicant.conf` ];then
wpa_supplicant -B -i wlan0 -c /userdata/cfg/wpa_supplicant.conf
fi
fi
fi
fi
fi
;;
stop)
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0