Skip to content
Snippets Groups Projects
Commit 5a37cf14 authored by Bob Mottram's avatar Bob Mottram
Browse files

wifi interface down before scan

parent 5c182edb
No related branches found
No related tags found
No related merge requests found
......@@ -71,8 +71,7 @@ function setup_wifi_atheros {
update_wifi_adaptors
if [ $IFACE ]; then
wpa_cli -i ${IFACE} terminate
ifdown --force $IFACE
ifup $IFACE
ifconfig $IFACE up
fi
}
......@@ -208,9 +207,8 @@ function hotspot_off {
echo 'source-directory /etc/network/interfaces.d' >> /etc/network/interfaces
fi
systemctl restart network-manager
wpa_cli -i ${WIFI_INTERFACE} terminate
ifdown --force ${WIFI_INTERFACE}
systemctl restart network-manager
}
function hotspot_on {
......@@ -277,7 +275,7 @@ function hotspot_on {
echo " bridge_ports $WIFI_INTERFACE eth0" >> /etc/network/interfaces
systemctl restart network-manager
ifup $WIFI_INTERFACE
ifconfig $WIFI_INTERFACE up
systemctl restart hostapd
}
......@@ -305,7 +303,7 @@ function wifi_wpa2_psk {
wpa_passphrase "$ssid" "$passphrase" > $WIFI_CONFIG
systemctl restart network-manager
ifup ${WIFI_INTERFACE}
ifconfig ${WIFI_INTERFACE} up
}
function wifi_none {
......@@ -334,7 +332,7 @@ function wifi_none {
echo '}' >> $WIFI_CONFIG
systemctl restart network-manager
ifup ${WIFI_INTERFACE}
ifconfig ${WIFI_INTERFACE} up
}
function networks_from_file {
......@@ -402,7 +400,7 @@ function networks_from_file {
chattr -i /etc/resolv.conf
systemctl restart network-manager
ifup ${WIFI_INTERFACE}
ifconfig ${WIFI_INTERFACE} up
}
function create_networks_interactive {
......@@ -497,7 +495,6 @@ function disable_wifi {
echo 'source-directory /etc/network/interfaces.d' >> /etc/network/interfaces
systemctl restart network-manager
wpa_cli -i ${WIFI_INTERFACE} terminate
ifdown --force ${WIFI_INTERFACE}
else
networks_from_file
fi
......
......@@ -85,9 +85,6 @@ do
WIFI_INTERFACE=${1}
wifi_interface_specified=1
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
wpa_cli -i ${WIFI_INTERFACE} terminate
ifdown --force ${WIFI_INTERFACE}
ifup ${WIFI_INTERFACE}
;;
-t|--type)
shift
......@@ -136,6 +133,7 @@ if [ ${NETWORKS_INTERACTIVE} ]; then
fi
if [ ! ${wifi_interface_specified} ]; then
wpa_cli -i ${WIFI_INTERFACE} terminate
update_wifi_adaptors
if [ ! $IFACE ]; then
echo $'No wifi adaptors were found'
......@@ -144,9 +142,7 @@ if [ ! ${wifi_interface_specified} ]; then
WIFI_INTERFACE=${IFACE}
echo "Adaptor: $WIFI_INTERFACE"
write_config_param "WIFI_INTERFACE" "$WIFI_INTERFACE"
wpa_cli -i ${WIFI_INTERFACE} terminate
ifdown --force ${WIFI_INTERFACE}
ifup ${WIFI_INTERFACE}
ifconfig ${WIFI_INTERFACE} up
fi
if [ ${WIFI_DISABLE} ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment