Przeglądaj źródła

Only write wifi interface if parameters are given

Bob Mottram 8 lat temu
rodzic
commit
119bd00f7b
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3
    2
      src/freedombone-utils-wifi

+ 3
- 2
src/freedombone-utils-wifi Wyświetl plik

368
 }
368
 }
369
 
369
 
370
 function create_networks_interactive {
370
 function create_networks_interactive {
371
+    remove_config_param "WIFI_INTERFACE"
371
     update_wifi_adaptors
372
     update_wifi_adaptors
372
     if [ ! $IFACE ]; then
373
     if [ ! $IFACE ]; then
373
         # Don't try to configure wifi if there are no adaptors
374
         # Don't try to configure wifi if there are no adaptors
374
-        remove_config_param "WIFI_INTERFACE"
375
         return
375
         return
376
     fi
376
     fi
377
-    write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
378
 
377
 
379
     if [ -f $WIFI_NETWORKS_FILE ]; then
378
     if [ -f $WIFI_NETWORKS_FILE ]; then
380
         rm $WIFI_NETWORKS_FILE
379
         rm $WIFI_NETWORKS_FILE
433
         if [ ${#WIFI_SSID} -gt 1 ]; then
432
         if [ ${#WIFI_SSID} -gt 1 ]; then
434
             if [ ${#WIFI_TYPE} -gt 1 ]; then
433
             if [ ${#WIFI_TYPE} -gt 1 ]; then
435
                 if [[ "${WIFI_TYPE}" == $'none' || "${WIFI_TYPE}" == $'open' ]]; then
434
                 if [[ "${WIFI_TYPE}" == $'none' || "${WIFI_TYPE}" == $'open' ]]; then
435
+                    write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
436
                     return
436
                     return
437
                 else
437
                 else
438
                     if [ ${#WIFI_PASSPHRASE} -gt 1 ]; then
438
                     if [ ${#WIFI_PASSPHRASE} -gt 1 ]; then
439
+                        write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
439
                         return
440
                         return
440
                     fi
441
                     fi
441
                 fi
442
                 fi