down the wifi when I connect with cable

This commit is contained in:
Felix Van der Jeugt 2017-08-01 15:38:42 +02:00
parent a410f361e6
commit b357ae0a6b
No known key found for this signature in database
GPG Key ID: 58B209295023754D

View File

@ -3,13 +3,15 @@
# Reading our private mac # Reading our private mac
here="$(dirname "$0")" here="$(dirname "$0")"
mac="$(cat "$here/macaddress")" mac="$(cat "$here/macaddress")"
link="$(basename /sys/class/net/enp*)" enp="$(basename /sys/class/net/enp*)"
wlp="$(basename /sys/class/net/wlp*)"
# Setting the MAC address for our wired # Setting the MAC address for our wired
sudo ip link set "$link" down sudo ip link set "$enp" down
sudo ip link set "$link" address "$mac" sudo ip link set "$enp" address "$mac"
sudo ip link set "$link" up sudo ip link set "$enp" up
# No more wireless # No more wireless
sudo sv stop wpa_supplicant sudo sv stop wpa_supplicant
sudo ip link set "$wlp" down