From 64766a11b8e6608e6eea090ada106b3f52410ef2 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Thu, 5 Mar 2020 18:51:52 -0600 Subject: [PATCH] Randomize MAC for armbian devices --- setup/setup_device.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 34460889..7a234cf1 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -582,6 +582,16 @@ rm -rf /tmp/* rm -rf ~/setup_device.sh rm -rf /etc/motd # Remove simple motd for update-motd.d +# Reset MAC address for Armbian devices +if [ $IS_ARMBIAN = 1 ] ; then + . /usr/lib/armbian/armbian-common + CONNECTION="$(nmcli -f UUID,ACTIVE,DEVICE,TYPE connection show --active | tail -n1)" + UUID=$(awk -F" " '/ethernet/ {print $1}' <<< "${CONNECTION}") + get_random_mac + nmcli connection modify $UUID ethernet.cloned-mac-address $MACADDR + nmcli connection modify $UUID -ethernet.mac-address "" +fi + sync set +x