From f7a4eea2a5d542a0c237a18215ce494e1ef74765 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Fri, 21 Oct 2016 10:34:10 +0200 Subject: [PATCH] dynamic interface name --- local/bin/macspoofer.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/local/bin/macspoofer.sh b/local/bin/macspoofer.sh index 61d795a..ba3466f 100755 --- a/local/bin/macspoofer.sh +++ b/local/bin/macspoofer.sh @@ -3,8 +3,9 @@ # Reading our private mac here="$(dirname "$0")" mac="$(cat "$here/macaddress")" +link="$(ip link | grep enp | tr -d ' ' | cut -d: -f2)" # Setting the MAC address for our wired -sudo ip link set enp5s0u1u4 down -sudo ip link set enp5s0u1u4 address "$mac" -sudo ip link set enp5s0u1u4 up +sudo ip link set "$link" down +sudo ip link set "$link" address "$mac" +sudo ip link set "$link" up