rk3568_ubuntu_r60_v1.3.2/app/qsetting/S80wifireconnect
2023-11-03 06:12:44 +00:00

29 lines
628 B
Bash
Executable File

#!/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