Kaynağa Gözat

Only write wifi interface if parameters are given

Bob Mottram 8 yıl önce
ebeveyn
işleme
119bd00f7b
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3
    2
      src/freedombone-utils-wifi

+ 3
- 2
src/freedombone-utils-wifi Dosyayı Görüntüle

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