hc
2025-02-14 bbb9540dc49f70f6b703d1c8d1b85fa5f602d86e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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