浏览代码

Tidying wifi command

Bob Mottram 7 年前
父节点
当前提交
94053f6bed

+ 1
- 1
src/freedombone 查看文件

@@ -117,7 +117,7 @@ if [[ $command_options == "menuconfig"* ]]; then
117 117
     fi
118 118
     rm $interactive_file
119 119
 else
120
-    while [[ $# > 1 ]]
120
+    while [ $# -gt 1 ]
121 121
     do
122 122
         key="$1"
123 123
 

+ 1
- 1
src/freedombone-addcert 查看文件

@@ -85,7 +85,7 @@ function show_help {
85 85
     exit 0
86 86
 }
87 87
 
88
-while [[ $# > 1 ]]
88
+while [ $# -gt 1 ]
89 89
 do
90 90
     key="$1"
91 91
 

+ 1
- 1
src/freedombone-addemail 查看文件

@@ -47,7 +47,7 @@ function show_help {
47 47
     exit 0
48 48
 }
49 49
 
50
-while [[ $# > 1 ]]
50
+while [ $# -gt 1 ]
51 51
 do
52 52
     key="$1"
53 53
 

+ 1
- 1
src/freedombone-addlist 查看文件

@@ -47,7 +47,7 @@ function show_help {
47 47
     exit 0
48 48
 }
49 49
 
50
-while [[ $# > 1 ]]
50
+while [ $# -gt 1 ]
51 51
 do
52 52
     key="$1"
53 53
 

+ 1
- 1
src/freedombone-clientcert 查看文件

@@ -57,7 +57,7 @@ function show_help {
57 57
     exit 0
58 58
 }
59 59
 
60
-while [[ $# > 1 ]]
60
+while [ $# -gt 1 ]
61 61
 do
62 62
 key="$1"
63 63
 

+ 1
- 1
src/freedombone-config 查看文件

@@ -810,7 +810,7 @@ function validate_freedns_code {
810 810
 }
811 811
 
812 812
 # Get the commandline options
813
-while [[ $# > 1 ]]
813
+while [ $# -gt 1 ]
814 814
 do
815 815
     key="$1"
816 816
 

+ 1
- 1
src/freedombone-dhparam 查看文件

@@ -179,7 +179,7 @@ function regenerate_dh_keys {
179 179
     done
180 180
 }
181 181
 
182
-while [[ $# > 1 ]]
182
+while [ $# -gt 1 ]
183 183
 do
184 184
     key="$1"
185 185
 

+ 1
- 1
src/freedombone-ignore 查看文件

@@ -46,7 +46,7 @@ function show_help {
46 46
     exit 0
47 47
 }
48 48
 
49
-while [[ $# > 1 ]]
49
+while [ $# -gt 1 ]
50 50
 do
51 51
 key="$1"
52 52
 

+ 1
- 1
src/freedombone-image 查看文件

@@ -293,7 +293,7 @@ function mesh_router_setup_script {
293 293
     echo 'WIFI_CHANNEL=9' >> $mesh_script_filename
294 294
 }
295 295
 
296
-while [[ $# > 1 ]]
296
+while [ $# -gt 1 ]
297 297
 do
298 298
     key="$1"
299 299
 

+ 1
- 1
src/freedombone-keydrive 查看文件

@@ -48,7 +48,7 @@ function show_help {
48 48
     exit 0
49 49
 }
50 50
 
51
-while [[ $# > 1 ]]
51
+while [ $# -gt 1 ]
52 52
 do
53 53
     key="$1"
54 54
 

+ 1
- 1
src/freedombone-mesh-install 查看文件

@@ -275,7 +275,7 @@ function mesh_tox_client_toxic_from_repo {
275 275
     echo "Toxic Installed."
276 276
 }
277 277
 
278
-while [[ $# > 1 ]]
278
+while [ $# -gt 1 ]
279 279
 do
280 280
     key="$1"
281 281
 

+ 1
- 1
src/freedombone-pass 查看文件

@@ -188,7 +188,7 @@ function export_to_keepass {
188 188
     echo $"Exported $filename"
189 189
 }
190 190
 
191
-while [[ $# > 1 ]]
191
+while [ $# -gt 1 ]
192 192
 do
193 193
     key="$1"
194 194
 

+ 1
- 1
src/freedombone-recoverkey 查看文件

@@ -53,7 +53,7 @@ function show_help {
53 53
     exit 0
54 54
 }
55 55
 
56
-while [[ $# > 1 ]]
56
+while [ $# -gt 1 ]
57 57
 do
58 58
     key="$1"
59 59
 

+ 1
- 1
src/freedombone-remote 查看文件

@@ -75,7 +75,7 @@ function show_help {
75 75
 }
76 76
 
77 77
 # Get the commandline options
78
-while [[ $# > 1 ]]
78
+while [ $# -gt 1 ]
79 79
 do
80 80
     key="$1"
81 81
 

+ 1
- 1
src/freedombone-renew-cert 查看文件

@@ -172,7 +172,7 @@ function renew_startssl {
172 172
     ${PROJECT_NAME}-pin-cert $HOSTNAME remove
173 173
 }
174 174
 
175
-while [[ $# > 1 ]]
175
+while [ $# -gt 1 ]
176 176
 do
177 177
 key="$1"
178 178
 

+ 1
- 1
src/freedombone-rmemail 查看文件

@@ -43,7 +43,7 @@ function show_help {
43 43
     exit 0
44 44
 }
45 45
 
46
-while [[ $# > 1 ]]
46
+while [ $# -gt 1 ]
47 47
 do
48 48
 key="$1"
49 49
 

+ 1
- 1
src/freedombone-rmlist 查看文件

@@ -45,7 +45,7 @@ function show_help {
45 45
     exit 0
46 46
 }
47 47
 
48
-while [[ $# > 1 ]]
48
+while [ $# -gt 1 ]
49 49
 do
50 50
 key="$1"
51 51
 

+ 1
- 1
src/freedombone-sec 查看文件

@@ -1328,7 +1328,7 @@ function show_help {
1328 1328
 
1329 1329
 
1330 1330
 # Get the commandline options
1331
-while [[ $# > 1 ]]
1331
+while [ $# -gt 1 ]
1332 1332
 do
1333 1333
     key="$1"
1334 1334
 

+ 1
- 1
src/freedombone-splitkey 查看文件

@@ -55,7 +55,7 @@ function show_help {
55 55
     exit 0
56 56
 }
57 57
 
58
-while [[ $# > 1 ]]
58
+while [ $# -gt 1 ]
59 59
 do
60 60
 key="$1"
61 61
 

+ 1
- 1
src/freedombone-template 查看文件

@@ -74,7 +74,7 @@ function show_help {
74 74
     exit 0
75 75
 }
76 76
 
77
-while [[ $# > 1 ]]
77
+while [ $# -gt 1 ]
78 78
 do
79 79
     key="$1"
80 80
 

+ 1
- 1
src/freedombone-tests 查看文件

@@ -1217,7 +1217,7 @@ function test_stig {
1217 1217
     fi
1218 1218
 }
1219 1219
 
1220
-while [[ $# > 1 ]]
1220
+while [ $# -gt 1 ]
1221 1221
 do
1222 1222
     key="$1"
1223 1223
 

+ 1
- 1
src/freedombone-unignore 查看文件

@@ -46,7 +46,7 @@ function show_help {
46 46
     exit 0
47 47
 }
48 48
 
49
-while [[ $# > 1 ]]
49
+while [ $# -gt 1 ]
50 50
 do
51 51
 key="$1"
52 52
 

+ 10
- 11
src/freedombone-wifi 查看文件

@@ -75,7 +75,7 @@ function show_help {
75 75
     exit 0
76 76
 }
77 77
 
78
-while [[ $# > 1 ]]
78
+while [ $# -gt 1 ]
79 79
 do
80 80
     key="$1"
81 81
 
@@ -144,11 +144,11 @@ if [ ${NETWORKS_INTERACTIVE} ]; then
144 144
 fi
145 145
 
146 146
 if [ ! ${wifi_interface_specified} ]; then
147
-    if [ ! $WAIT_SEC ]; then
148
-       wpa_action ${WIFI_INTERFACE} stop
149
-       wpa_cli -i ${WIFI_INTERFACE} terminate
147
+    if [ ! "$WAIT_SEC" ]; then
148
+       wpa_action "${WIFI_INTERFACE}" stop
149
+       wpa_cli -i "${WIFI_INTERFACE}" terminate
150 150
     else
151
-        sleep ${WAIT_SEC}
151
+        sleep "${WAIT_SEC}"
152 152
     fi
153 153
     update_wifi_adaptors
154 154
     if [ ! $IFACE ]; then
@@ -166,7 +166,7 @@ if [ ${WIFI_DISABLE} ]; then
166 166
 fi
167 167
 
168 168
 if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
169
-    if [ -f ${WIFI_NETWORKS_FILE} ]; then
169
+    if [ -f "${WIFI_NETWORKS_FILE}" ]; then
170 170
         wifi_established=
171 171
         wifi_retry_ctr=0
172 172
         while [ ! $wifi_established ]; do
@@ -184,7 +184,7 @@ if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
184 184
             fi
185 185
             # has the limit of retries been reached?
186 186
             wifi_retry_ctr=$((wifi_retry_ctr+1))
187
-            if [ ${wifi_retry_ctr} -ge ${WIFI_MAX_RETRIES} ]; then
187
+            if [ ${wifi_retry_ctr} -ge "${WIFI_MAX_RETRIES}" ]; then
188 188
                 break
189 189
             fi
190 190
         done
@@ -198,14 +198,13 @@ if [[ ${WIFI_HOTSPOT} == 'no' ]]; then
198 198
     fi
199 199
 fi
200 200
 
201
-if [ ! ${WIFI_SSID} ]; then
201
+if [ ! "${WIFI_SSID}" ]; then
202 202
     echo $'No SSID given'
203 203
     exit 1
204 204
 fi
205 205
 
206 206
 if [[ ${WIFI_HOTSPOT} != 'no' ]]; then
207
-    hotspot_on
208
-    if [ ! "$?" = "0" ]; then
207
+    if ! hotspot_on; then
209 208
         exit "$?"
210 209
     fi
211 210
     exit 0
@@ -214,7 +213,7 @@ else
214 213
 fi
215 214
 
216 215
 if [[ "$WIFI_TYPE" != 'none' && "$WIFI_TYPE" != 'open' ]]; then
217
-    if [ ! $WIFI_PASSPHRASE ]; then
216
+    if [ ! "$WIFI_PASSPHRASE" ]; then
218 217
         echo $'No wifi passphrase was given'
219 218
         exit 2
220 219
     fi