| 
				
			 | 
			
			
				@@ -165,34 +165,36 @@ if [ ${WIFI_DISABLE} ]; then 
			 | 
		
	
		
			
			| 
				165
			 | 
			
				165
			 | 
			
			
				     exit 0 
			 | 
		
	
		
			
			| 
				166
			 | 
			
				166
			 | 
			
			
				 fi 
			 | 
		
	
		
			
			| 
				167
			 | 
			
				167
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				168
			 | 
			
				
			 | 
			
			
				-if [ -f ${WIFI_NETWORKS_FILE} ]; then 
			 | 
		
	
		
			
			| 
				169
			 | 
			
				
			 | 
			
			
				-    wifi_established= 
			 | 
		
	
		
			
			| 
				170
			 | 
			
				
			 | 
			
			
				-    wifi_retry_ctr=0 
			 | 
		
	
		
			
			| 
				171
			 | 
			
				
			 | 
			
			
				-    while [ ! $wifi_established ]; do 
			 | 
		
	
		
			
			| 
				172
			 | 
			
				
			 | 
			
			
				-        if [ ${wifi_retry_ctr} -gt 0 ]; then 
			 | 
		
	
		
			
			| 
				173
			 | 
			
				
			 | 
			
			
				-            wpa_action ${WIFI_INTERFACE} stop 
			 | 
		
	
		
			
			| 
				174
			 | 
			
				
			 | 
			
			
				-            wpa_cli -i ${WIFI_INTERFACE} terminate 
			 | 
		
	
		
			
			| 
				175
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				176
			 | 
			
				
			 | 
			
			
				-        networks_from_file 
			 | 
		
	
		
			
			| 
				177
			 | 
			
				
			 | 
			
			
				-        # allow some time for a connection to be established 
			 | 
		
	
		
			
			| 
				178
			 | 
			
				
			 | 
			
			
				-        sleep 5 
			 | 
		
	
		
			
			| 
				179
			 | 
			
				
			 | 
			
			
				-        # has it worked? 
			 | 
		
	
		
			
			| 
				180
			 | 
			
				
			 | 
			
			
				-        if [[ $(wifi_is_running) != "0" ]]; then 
			 | 
		
	
		
			
			| 
				181
			 | 
			
				
			 | 
			
			
				-            wifi_established=1 
			 | 
		
	
		
			
			| 
				182
			 | 
			
				
			 | 
			
			
				-            break 
			 | 
		
	
		
			
			| 
				183
			 | 
			
				
			 | 
			
			
				-        fi 
			 | 
		
	
		
			
			| 
				184
			 | 
			
				
			 | 
			
			
				-        # has the limit of retries been reached? 
			 | 
		
	
		
			
			| 
				185
			 | 
			
				
			 | 
			
			
				-        wifi_retry_ctr=$((wifi_retry_ctr+1)) 
			 | 
		
	
		
			
			| 
				186
			 | 
			
				
			 | 
			
			
				-        if [ ${wifi_retry_ctr} -ge ${WIFI_MAX_RETRIES} ]; then 
			 | 
		
	
		
			
			| 
				187
			 | 
			
				
			 | 
			
			
				-            break 
			 | 
		
	
		
			
			| 
				
			 | 
			
				168
			 | 
			
			
				+if [[ ${WIFI_HOTSPOT} == 'no' ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				169
			 | 
			
			
				+    if [ -f ${WIFI_NETWORKS_FILE} ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				170
			 | 
			
			
				+        wifi_established= 
			 | 
		
	
		
			
			| 
				
			 | 
			
				171
			 | 
			
			
				+        wifi_retry_ctr=0 
			 | 
		
	
		
			
			| 
				
			 | 
			
				172
			 | 
			
			
				+        while [ ! $wifi_established ]; do 
			 | 
		
	
		
			
			| 
				
			 | 
			
				173
			 | 
			
			
				+            if [ ${wifi_retry_ctr} -gt 0 ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				174
			 | 
			
			
				+                wpa_action ${WIFI_INTERFACE} stop 
			 | 
		
	
		
			
			| 
				
			 | 
			
				175
			 | 
			
			
				+                wpa_cli -i ${WIFI_INTERFACE} terminate 
			 | 
		
	
		
			
			| 
				
			 | 
			
				176
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				177
			 | 
			
			
				+            networks_from_file 
			 | 
		
	
		
			
			| 
				
			 | 
			
				178
			 | 
			
			
				+            # allow some time for a connection to be established 
			 | 
		
	
		
			
			| 
				
			 | 
			
				179
			 | 
			
			
				+            sleep 5 
			 | 
		
	
		
			
			| 
				
			 | 
			
				180
			 | 
			
			
				+            # has it worked? 
			 | 
		
	
		
			
			| 
				
			 | 
			
				181
			 | 
			
			
				+            if [[ $(wifi_is_running) != "0" ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				182
			 | 
			
			
				+                wifi_established=1 
			 | 
		
	
		
			
			| 
				
			 | 
			
				183
			 | 
			
			
				+                break 
			 | 
		
	
		
			
			| 
				
			 | 
			
				184
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				185
			 | 
			
			
				+            # has the limit of retries been reached? 
			 | 
		
	
		
			
			| 
				
			 | 
			
				186
			 | 
			
			
				+            wifi_retry_ctr=$((wifi_retry_ctr+1)) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				187
			 | 
			
			
				+            if [ ${wifi_retry_ctr} -ge ${WIFI_MAX_RETRIES} ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				188
			 | 
			
			
				+                break 
			 | 
		
	
		
			
			| 
				
			 | 
			
				189
			 | 
			
			
				+            fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				190
			 | 
			
			
				+        done 
			 | 
		
	
		
			
			| 
				
			 | 
			
				191
			 | 
			
			
				+        if [ $wifi_established ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				192
			 | 
			
			
				+            wpa_cli status 
			 | 
		
	
		
			
			| 
				
			 | 
			
				193
			 | 
			
			
				+            exit 0 
			 | 
		
	
		
			
			| 
				
			 | 
			
				194
			 | 
			
			
				+        else 
			 | 
		
	
		
			
			| 
				
			 | 
			
				195
			 | 
			
			
				+            echo $'Wifi could not be started' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				196
			 | 
			
			
				+            exit 4 
			 | 
		
	
		
			
			| 
				188
			 | 
			
				197
			 | 
			
			
				         fi 
			 | 
		
	
		
			
			| 
				189
			 | 
			
				
			 | 
			
			
				-    done 
			 | 
		
	
		
			
			| 
				190
			 | 
			
				
			 | 
			
			
				-    if [ $wifi_established ]; then 
			 | 
		
	
		
			
			| 
				191
			 | 
			
				
			 | 
			
			
				-        wpa_cli status 
			 | 
		
	
		
			
			| 
				192
			 | 
			
				
			 | 
			
			
				-        exit 0 
			 | 
		
	
		
			
			| 
				193
			 | 
			
				
			 | 
			
			
				-    else 
			 | 
		
	
		
			
			| 
				194
			 | 
			
				
			 | 
			
			
				-        echo $'Wifi could not be started' 
			 | 
		
	
		
			
			| 
				195
			 | 
			
				
			 | 
			
			
				-        exit 4 
			 | 
		
	
		
			
			| 
				196
			 | 
			
				198
			 | 
			
			
				     fi 
			 | 
		
	
		
			
			| 
				197
			 | 
			
				199
			 | 
			
			
				 fi 
			 | 
		
	
		
			
			| 
				198
			 | 
			
				200
			 | 
			
			
				  
			 |