瀏覽代碼

Ensure that wifi interface is set in config file

Bob Mottram 8 年之前
父節點
當前提交
dfd4573ddc
共有 2 個檔案被更改,包括 6 行新增0 行删除
  1. 2
    0
      src/freedombone-utils-wifi
  2. 4
    0
      src/freedombone-wifi

+ 2
- 0
src/freedombone-utils-wifi 查看文件

@@ -371,8 +371,10 @@ function create_networks_interactive {
371 371
     update_wifi_adaptors
372 372
     if [ ! $IFACE ]; then
373 373
         # Don't try to configure wifi if there are no adaptors
374
+        remove_config_param "WIFI_INTERFACE"
374 375
         return
375 376
     fi
377
+    write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
376 378
 
377 379
     if [ -f $WIFI_NETWORKS_FILE ]; then
378 380
         rm $WIFI_NETWORKS_FILE

+ 4
- 0
src/freedombone-wifi 查看文件

@@ -50,6 +50,7 @@ WIFI_DISABLE=
50 50
 IFACE=
51 51
 IFACE_SECONDARY=
52 52
 
53
+source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-config
53 54
 source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-wifi
54 55
 
55 56
 function show_help {
@@ -83,6 +84,7 @@ do
83 84
             shift
84 85
             WIFI_INTERFACE=${1}
85 86
             wifi_interface_specified=1
87
+            write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
86 88
             ;;
87 89
         -t|--type)
88 90
             shift
@@ -137,10 +139,12 @@ if [ ! $wifi_interface_specified= ]; then
137 139
         exit 872356
138 140
     fi
139 141
     WIFI_INTERFACE=$IFACE
142
+    write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
140 143
 fi
141 144
 
142 145
 if [ $WIFI_DISABLE ]; then
143 146
     disable_wifi $WIFI_DISABLE
147
+    remove_config_param "WIFI_INTERFACE"
144 148
     exit 0
145 149
 fi
146 150