10 skipped lines |
|
|
|
| | 14 | | if [ ! -f /usr/bin/wifi_manager ]; then |
| | 15 | | AP_CONFIG_FILE=${WPA_CONF_FILE} |
| | 16 | | fi |
| | 17 | | |
14 | | 18 | | function set_wifi_log() |
|
|
16 | | 20 | | echo `date` "$1" >> ${WIFI_LOG} |
|
13 skipped lines |
30 | | 34 | | function reboot_wifi_model() |
|
|
32 | | 36 | | killall -9 wpa_supplicant |
|
33 | | killall -9 wifi_manager | | |
34 | | 37 | | set_wifi_log "restart wifi driver" |
|
|
36 | | rmmod 8189fs | | 39 | | /usr/bin/wifi_act.sh rmmod |
|
38 | | 41 | | /etc/init.d/wifi.sh |
|
|
40 | | 43 | | /etc/init.d/wpa_supplicant.sh |
|
41 | | sleep 2 | | |
42 | | /etc/rc.d/wifi_manager.sh | | |
|
|
|
46 | | 47 | | function restart_wifi_model() |
|
|
48 | | 49 | | killall -9 wpa_supplicant |
|
49 | | killall -9 wifi_manager | | |
50 | | 50 | | set_wifi_log "restart wifi application" |
|
|
52 | | 52 | | /etc/init.d/wpa_supplicant.sh |
|
53 | | sleep 2 | | |
54 | | /etc/rc.d/wifi_manager.sh | | |
|
|
|
33 skipped lines |
|
|
|
94 | | WPA_PID=`pidof -o %PPID wpa_supplicant` | | 92 | | WPAS_PID=`pidof -o %PPID wpa_supplicant` |
| | 93 | | WPAC_PID=`pidof -o %PPID wpa_cli` |
95 | | if [ -z "${WPA_PID}" ]; then | | 94 | | if [ -z "${WPAS_PID}" -o -z "${WPAC_PID}" ]; then |
96 | | set_wifi_log "restart wpa_supplicant" | | 95 | | set_wifi_log "restart wpa_supplicant wpa_cli" |
97 | | 96 | | /etc/init.d/wpa_supplicant.sh |
|
|
|
|
101 | | WIFIMG_PID=`pidof -o %PPID wifi_manager` | | |
102 | | if [ -z "${WIFIMG_PID}" ]; then | | |
103 | | sleep 5 | | |
104 | | WIFIMG_PID2=`pidof -o %PPID wifi_manager` | | |
105 | | if [ -z "${WIFIMG_PID2}" ]; then | | |
106 | | set_wifi_log "restart wifi_manager" | | |
107 | | /etc/rc.d/wifi_manager.sh | | |
108 | | set_wifi_cnt 0 | | |
109 | | return 3 | | |
110 | | fi | | |
111 | | fi | | |
|
|
|
6 skipped lines |
|
122 | | 110 | | if [ -f ${WIFI_DISCONNECT} ]; then |
|
123 | | 111 | | SRC_COUNT=`grep -w "ssid" ${AP_CONFIG_FILE} | wc -l` |
|
124 | | | | |
125 | | 112 | | if [ ${SRC_COUNT} -gt 0 ]; then |
|
|
127 | | 114 | | set_wifi_cnt ${WIFI_COUNT} |
|
128 | | if [ ${WIFI_COUNT} -ge 15 ]; then | | 115 | | if [ ${WIFI_COUNT} -ge 30 ]; then |
129 | | 116 | | restart_wifi_model |
|
|
|
15 skipped lines |
|
|
149 | | 136 | | set_wifi_log "gate way ip is null" |
|
| | 137 | | if [ -f /etc/wifi/udhcpc.sh ]; then |
| | 138 | | /etc/wifi/udhcpc.sh & |
| | 139 | | else |
| | 140 | | udhcpc.sh & |
| | 141 | | fi |
|
|
|
12 skipped lines |
165 | | 157 | | if [ ${SRC_COUNT} -gt 0 ]; then |
|
166 | | 158 | | WPA_STATE=`wpa_cli status | grep -w wpa_state | cut -d '=' -f 2` |
|
167 | | 159 | | if [ "${WPA_STATE}" == "COMPLETED" ]; then |
|
168 | | UDHCPC_PID=`pidof -o %PPID udhcpc` | | |
169 | | if [ -z "${UDHCPC_PID}" ]; then | | 160 | | if [ -f ${WIFI_CONF_FILE} ]; then |
170 | | sleep 10 | | 161 | | BSSID=`wpa_cli status | grep bssid | awk -F"=" '{print $NF}'` |
171 | | UDHCPC_PID=`pidof -o %PPID udhcpc` | | |
172 | | if [ -z "${UDHCPC_PID}" ]; then | | |
173 | | set_wifi_log "no udhcpc, start it" | | |
174 | | /etc/wifi/udhcpc.sh >/dev/null 2>&1 & | | |
175 | | fi | | |
176 | | else | | |
177 | | if [ -f ${WIFI_CONF_FILE} ]; then | | |
178 | | touch ${WIFI_CONNECT} | | 162 | | echo "${BSSID}" > ${WIFI_CONNECT} |
179 | | fsync ${WIFI_CONNECT} | | 163 | | fsync ${WIFI_CONNECT} |
180 | | fi | | |
|
|
183 | | 166 | | if [ -f ${WIFI_CONF_FILE} ]; then |
|
18 skipped lines |
|
|
|
205 | | if [ ! -f ${MIIO_WIFI_FILE} ]; then | | 188 | | if [ ! -f ${WIFI_CONF_FILE} ]; then |
|
|
|
13 skipped lines |