dynamic interface name

This commit is contained in:
Felix Van der Jeugt 2016-10-21 10:34:10 +02:00
parent 42c6134445
commit f7a4eea2a5

View File

@ -3,8 +3,9 @@
# Reading our private mac # Reading our private mac
here="$(dirname "$0")" here="$(dirname "$0")"
mac="$(cat "$here/macaddress")" mac="$(cat "$here/macaddress")"
link="$(ip link | grep enp | tr -d ' ' | cut -d: -f2)"
# Setting the MAC address for our wired # Setting the MAC address for our wired
sudo ip link set enp5s0u1u4 down sudo ip link set "$link" down
sudo ip link set enp5s0u1u4 address "$mac" sudo ip link set "$link" address "$mac"
sudo ip link set enp5s0u1u4 up sudo ip link set "$link" up