Bläddra i källkod

Tidying wifi command

Bob Mottram 7 år sedan
förälder
incheckning
94053f6bed

+ 1
- 1
src/freedombone Visa fil

117
     fi
117
     fi
118
     rm $interactive_file
118
     rm $interactive_file
119
 else
119
 else
120
-    while [[ $# > 1 ]]
120
+    while [ $# -gt 1 ]
121
     do
121
     do
122
         key="$1"
122
         key="$1"
123
 
123
 

+ 1
- 1
src/freedombone-addcert Visa fil

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

+ 1
- 1
src/freedombone-addemail Visa fil

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

+ 1
- 1
src/freedombone-addlist Visa fil

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

+ 1
- 1
src/freedombone-clientcert Visa fil

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

+ 1
- 1
src/freedombone-config Visa fil

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

+ 1
- 1
src/freedombone-dhparam Visa fil

179
     done
179
     done
180
 }
180
 }
181
 
181
 
182
-while [[ $# > 1 ]]
182
+while [ $# -gt 1 ]
183
 do
183
 do
184
     key="$1"
184
     key="$1"
185
 
185
 

+ 1
- 1
src/freedombone-ignore Visa fil

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

+ 1
- 1
src/freedombone-image Visa fil

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

+ 1
- 1
src/freedombone-keydrive Visa fil

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

+ 1
- 1
src/freedombone-mesh-install Visa fil

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

+ 1
- 1
src/freedombone-pass Visa fil

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

+ 1
- 1
src/freedombone-recoverkey Visa fil

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

+ 1
- 1
src/freedombone-remote Visa fil

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

+ 1
- 1
src/freedombone-renew-cert Visa fil

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

+ 1
- 1
src/freedombone-rmemail Visa fil

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

+ 1
- 1
src/freedombone-rmlist Visa fil

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

+ 1
- 1
src/freedombone-sec Visa fil

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

+ 1
- 1
src/freedombone-splitkey Visa fil

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

+ 1
- 1
src/freedombone-template Visa fil

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

+ 1
- 1
src/freedombone-tests Visa fil

1217
     fi
1217
     fi
1218
 }
1218
 }
1219
 
1219
 
1220
-while [[ $# > 1 ]]
1220
+while [ $# -gt 1 ]
1221
 do
1221
 do
1222
     key="$1"
1222
     key="$1"
1223
 
1223
 

+ 1
- 1
src/freedombone-unignore Visa fil

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

+ 10
- 11
src/freedombone-wifi Visa fil

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