|
@@ -85,8 +85,9 @@ do
|
85
|
85
|
WIFI_INTERFACE=${1}
|
86
|
86
|
wifi_interface_specified=1
|
87
|
87
|
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
|
88
|
|
- ifdown --force $WIFI_INTERFACE
|
89
|
|
- ifup $WIFI_INTERFACE
|
|
88
|
+ wpa_cli -i ${WIFI_INTERFACE} terminate
|
|
89
|
+ ifdown --force ${WIFI_INTERFACE}
|
|
90
|
+ ifup ${WIFI_INTERFACE}
|
90
|
91
|
;;
|
91
|
92
|
-t|--type)
|
92
|
93
|
shift
|
|
@@ -129,41 +130,42 @@ do
|
129
|
130
|
shift
|
130
|
131
|
done
|
131
|
132
|
|
132
|
|
-if [ $NETWORKS_INTERACTIVE ]; then
|
|
133
|
+if [ ${NETWORKS_INTERACTIVE} ]; then
|
133
|
134
|
create_networks_interactive
|
134
|
135
|
exit 0
|
135
|
136
|
fi
|
136
|
137
|
|
137
|
|
-if [ ! $wifi_interface_specified ]; then
|
|
138
|
+if [ ! ${wifi_interface_specified} ]; then
|
138
|
139
|
update_wifi_adaptors
|
139
|
140
|
if [ ! $IFACE ]; then
|
140
|
141
|
echo $'No wifi adaptors were found'
|
141
|
142
|
exit 872356
|
142
|
143
|
fi
|
143
|
|
- WIFI_INTERFACE=$IFACE
|
|
144
|
+ WIFI_INTERFACE=${IFACE}
|
144
|
145
|
echo "Adaptor: $WIFI_INTERFACE"
|
145
|
146
|
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
|
146
|
|
- ifdown --force $WIFI_INTERFACE
|
147
|
|
- ifup $WIFI_INTERFACE
|
|
147
|
+ wpa_cli -i ${WIFI_INTERFACE} terminate
|
|
148
|
+ ifdown --force ${WIFI_INTERFACE}
|
|
149
|
+ ifup ${WIFI_INTERFACE}
|
148
|
150
|
fi
|
149
|
151
|
|
150
|
|
-if [ $WIFI_DISABLE ]; then
|
151
|
|
- disable_wifi $WIFI_DISABLE
|
|
152
|
+if [ ${WIFI_DISABLE} ]; then
|
|
153
|
+ disable_wifi ${WIFI_DISABLE}
|
152
|
154
|
remove_config_param "WIFI_INTERFACE"
|
153
|
155
|
exit 0
|
154
|
156
|
fi
|
155
|
157
|
|
156
|
|
-if [ -f $WIFI_NETWORKS_FILE ]; then
|
|
158
|
+if [ -f ${WIFI_NETWORKS_FILE} ]; then
|
157
|
159
|
networks_from_file
|
158
|
160
|
exit 0
|
159
|
161
|
fi
|
160
|
162
|
|
161
|
|
-if [ ! $WIFI_SSID ]; then
|
|
163
|
+if [ ! ${WIFI_SSID} ]; then
|
162
|
164
|
echo $'No SSID given'
|
163
|
165
|
exit 1
|
164
|
166
|
fi
|
165
|
167
|
|
166
|
|
-if [[ $WIFI_HOTSPOT != 'no' ]]; then
|
|
168
|
+if [[ ${WIFI_HOTSPOT} != 'no' ]]; then
|
167
|
169
|
hotspot_on
|
168
|
170
|
exit 0
|
169
|
171
|
else
|
|
@@ -177,7 +179,7 @@ if [[ "$WIFI_TYPE" != 'none' && "$WIFI_TYPE" != 'open' ]]; then
|
177
|
179
|
fi
|
178
|
180
|
fi
|
179
|
181
|
|
180
|
|
-if [[ $WIFI_TYPE == 'wpa2-psk' ]]; then
|
|
182
|
+if [[ ${WIFI_TYPE} == 'wpa2-psk' ]]; then
|
181
|
183
|
if [ ! -d /etc/wpa_supplicant ]; then
|
182
|
184
|
echo $'wpasupplicant package is not installed'
|
183
|
185
|
exit 3
|