From f32235373d2b06fb596ea6819a94b0d4d8bd32b7 Mon Sep 17 00:00:00 2001 From: Aaron Murray Date: Thu, 1 Feb 2024 15:49:15 -0600 Subject: [PATCH] initial commit Signed-off-by: Aaron Murray --- preinstall | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 preinstall diff --git a/preinstall b/preinstall new file mode 100755 index 0000000..bef1a03 --- /dev/null +++ b/preinstall @@ -0,0 +1,13 @@ +#!/bin/bash + +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 +if [ -n "${mac}" ]; then + echo "mac - ${mac}" + echo -e "[Match]\nMACAddress=${mac}\n[Link]\nName=eth0" > /etc/systemd/network/10-persistent-eth0.link + echo "Please reboot the system now." +fi + +exit 0