Randomize MAC for armbian devices

This commit is contained in:
Taylor Helsper 2020-03-05 18:51:52 -06:00
parent 18782310a8
commit 64766a11b8

View File

@ -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