From 14e0a8f831131c6d6947ebeff507797fde938f6e Mon Sep 17 00:00:00 2001 From: Aaron Murray Date: Thu, 1 Feb 2024 15:38:08 -0600 Subject: [PATCH] improve mac address detection Signed-off-by: Aaron Murray --- install | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install b/install index 94fb4f0..7a2043d 100755 --- a/install +++ b/install @@ -15,7 +15,7 @@ # logfile="omv_install.log" -scriptversion="2.3.8" +scriptversion="2.3.9" _log() @@ -645,10 +645,13 @@ if [ ${skipNet} -ne 1 ]; then defLink="/etc/systemd/network/99-default.link" rm -fv "${defLink}" if [ ${rpi} -eq 1 ] && [ ${version} -eq 7 ]; then + _log "Force eth0 name on RPi ..." mac="$(ip -j a show dev eth0 | jq -r .[].address | head -n1)" + if [ -z "${mac}" ]; then + mac="$(ip -j a show dev end0 | jq -r .[].address | head -n1)" + fi _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