Regen MAC when setting up a new Rock64

This commit is contained in:
Taylor Helsper 2019-09-27 21:00:48 -05:00
parent 8d3fc8d465
commit bfb00f1536

View File

@ -341,6 +341,18 @@ systemctl enable tor
systemctl enable invalid_block_check
# Regenerate MAC Address for Rock64
if [ $IS_ROCK64 = 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
# Delete junk
rm -rf /home/admin/download
rm -rf /home/admin/.bash_history