force eth0 name on rpi

Signed-off-by: Aaron Murray <plugins@omv-extras.org>
This commit is contained in:
Aaron Murray 2024-02-01 10:13:19 -06:00
parent ce8178cae2
commit a84a178921

10
install
View File

@ -15,7 +15,7 @@
#
logfile="omv_install.log"
scriptversion="2.3.7"
scriptversion="2.3.8"
_log()
@ -644,6 +644,14 @@ if [ ${skipNet} -ne 1 ]; then
defLink="/etc/systemd/network/99-default.link"
rm -fv "${defLink}"
if [ ${rpi} -eq 1 ] && [ ${version} -eq 7 ]; then
mac="$(ip -j a show dev eth0 | jq -r .[].address | head -n1)"
_log "mac address - ${mac}"
if [ -n "${mac}" ]; then
_log "Force eth0 name on RPi ..."
echo -e "[Match]\nMACAddress=${mac}\n[Link]\nName=eth0" > /etc/systemd/network/10-persistent-eth0.link
fi
fi
_log "Removing network-manager and dhcpcd5 ..."
apt-get -y --autoremove purge network-manager dhcpcd5 2>&1 | tee -a ${logfile}