|
@@ -71,7 +71,7 @@ function hotspot_off {
|
71
|
71
|
fi
|
72
|
72
|
|
73
|
73
|
systemctl restart network-manager
|
74
|
|
- ifdown wlan0
|
|
74
|
+ ifdown $WIFI_INTERFACE
|
75
|
75
|
}
|
76
|
76
|
|
77
|
77
|
function hotspot_on {
|
|
@@ -138,7 +138,7 @@ function hotspot_on {
|
138
|
138
|
echo " bridge_ports $WIFI_INTERFACE eth0" >> /etc/network/interfaces
|
139
|
139
|
|
140
|
140
|
systemctl restart network-manager
|
141
|
|
- ifup wlan0
|
|
141
|
+ ifup $WIFI_INTERFACE
|
142
|
142
|
systemctl restart hostapd
|
143
|
143
|
}
|
144
|
144
|
|
|
@@ -159,8 +159,8 @@ function wifi_wpa2_psk {
|
159
|
159
|
echo 'allow-hotplug eth0' >> /etc/network/interfaces
|
160
|
160
|
echo 'iface eth0 inet dhcp' >> /etc/network/interfaces
|
161
|
161
|
echo '' >> /etc/network/interfaces
|
162
|
|
- echo 'allow-hotplug wlan0' >> /etc/network/interfaces
|
163
|
|
- echo 'iface wlan0 inet manual' >> /etc/network/interfaces
|
|
162
|
+ echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces
|
|
163
|
+ echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces
|
164
|
164
|
echo " wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces
|
165
|
165
|
echo '' >> /etc/network/interfaces
|
166
|
166
|
echo 'iface default inet dhcp' >> /etc/network/interfaces
|
|
@@ -168,7 +168,7 @@ function wifi_wpa2_psk {
|
168
|
168
|
wpa_passphrase "$ssid" "$passphrase" > $WIFI_CONFIG
|
169
|
169
|
|
170
|
170
|
systemctl restart network-manager
|
171
|
|
- ifup wlan0
|
|
171
|
+ ifup ${WIFI_INTERFACE}
|
172
|
172
|
}
|
173
|
173
|
|
174
|
174
|
function wifi_none {
|
|
@@ -187,8 +187,8 @@ function wifi_none {
|
187
|
187
|
echo 'allow-hotplug eth0' >> /etc/network/interfaces
|
188
|
188
|
echo 'iface eth0 inet dhcp' >> /etc/network/interfaces
|
189
|
189
|
echo '' >> /etc/network/interfaces
|
190
|
|
- echo 'allow-hotplug wlan0' >> /etc/network/interfaces
|
191
|
|
- echo 'iface wlan0 inet manual' >> /etc/network/interfaces
|
|
190
|
+ echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces
|
|
191
|
+ echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces
|
192
|
192
|
echo " wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces
|
193
|
193
|
echo '' >> /etc/network/interfaces
|
194
|
194
|
echo 'iface default inet dhcp' >> /etc/network/interfaces
|
|
@@ -199,7 +199,7 @@ function wifi_none {
|
199
|
199
|
echo '}' >> $WIFI_CONFIG
|
200
|
200
|
|
201
|
201
|
systemctl restart network-manager
|
202
|
|
- ifup wlan0
|
|
202
|
+ ifup ${WIFI_INTERFACE}
|
203
|
203
|
}
|
204
|
204
|
|
205
|
205
|
function networks_from_file {
|
|
@@ -220,8 +220,8 @@ function networks_from_file {
|
220
|
220
|
echo 'allow-hotplug eth0' >> /etc/network/interfaces
|
221
|
221
|
echo 'iface eth0 inet dhcp' >> /etc/network/interfaces
|
222
|
222
|
echo '' >> /etc/network/interfaces
|
223
|
|
- echo 'allow-hotplug wlan0' >> /etc/network/interfaces
|
224
|
|
- echo 'iface wlan0 inet manual' >> /etc/network/interfaces
|
|
223
|
+ echo "allow-hotplug ${WIFI_INTERFACE}" >> /etc/network/interfaces
|
|
224
|
+ echo "iface ${WIFI_INTERFACE} inet manual" >> /etc/network/interfaces
|
225
|
225
|
echo " wpa-roam $WIFI_CONFIG" >> /etc/network/interfaces
|
226
|
226
|
echo '' >> /etc/network/interfaces
|
227
|
227
|
echo 'iface default inet dhcp' >> /etc/network/interfaces
|
|
@@ -263,7 +263,7 @@ function networks_from_file {
|
263
|
263
|
done < $WIFI_NETWORKS_FILE
|
264
|
264
|
|
265
|
265
|
systemctl restart network-manager
|
266
|
|
- ifup wlan0
|
|
266
|
+ ifup ${WIFI_INTERFACE}
|
267
|
267
|
}
|
268
|
268
|
|
269
|
269
|
function create_networks_interactive {
|
|
@@ -348,7 +348,7 @@ function disable_wifi {
|
348
|
348
|
echo '# Include files from /etc/network/interfaces.d:' >> /etc/network/interfaces
|
349
|
349
|
echo 'source-directory /etc/network/interfaces.d' >> /etc/network/interfaces
|
350
|
350
|
systemctl restart network-manager
|
351
|
|
- ifdown wlan0
|
|
351
|
+ ifdown ${WIFI_INTERFACE}
|
352
|
352
|
else
|
353
|
353
|
networks_from_file
|
354
|
354
|
fi
|