From 8dd91209deda6b8adc65774ff28842888fe15812 Mon Sep 17 00:00:00 2001 From: Aaron Murray Date: Sun, 22 Dec 2019 14:38:33 -0600 Subject: [PATCH] remove network-manager and configure networkd on arm systems using network-manager --- install | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/install b/install index c85ae2c..2be777a 100755 --- a/install +++ b/install @@ -286,4 +286,26 @@ cat << EOF > ${ioniceCron} EOF chmod 600 ${ioniceCron} +# remove networkmanager and configure networkd +if [ ${version} -gt 4 ]; then + nic="$(awk '/^.*NetworkManager.*dhcp.*\(.*\)/ { print $9 }' /var/log/syslog | sort | uniq | sed 's/[^a-zA-Z0-9]//g' | tail -1)" + + if [ -n "${nic}" ]; then + echo "Removing network-manager ..." + apt-get -y --autoremove purge network-manager + + echo "Configure ${nic} to use networkd..." + echo -e "[Match]\nName=${nic}\n\n[Network]\nDHCP=both" > /etc/systemd/network/openmediavault-${nic,,}.network + + echo "Enable networkd ..." + systemctl enable systemd-networkd + + echo "Enable simple dns ..." + rm -f /etc/resolv.conf + echo "nameserver 1.1.1.1" > /etc/resolv.conf + + echo "It is recommended to run omv-firstaid or setup the network adapter in the openmediavault web interface." + fi +fi + exit 0