OpenMediaVault_installScript/preinstall
Aaron Murray a8e585c3d0 add note
Signed-off-by: Aaron Murray <plugins@omv-extras.org>
2024-07-31 19:30:55 -05:00

23 lines
603 B
Bash
Executable File

#!/bin/bash
# this script should be run when instructed to.
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
export LANG=C.UTF-8
export LANGUAGE=C
export LC_ALL=C.UTF-8
apt-get --yes --no-install-recommends install jq
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