From 31cf513c07cf3192a4e9c745baca0a00d44d3be3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 16 Jul 2023 18:18:58 -0500 Subject: [PATCH] Update linupx-scripts.sh --- linupx-scripts.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/linupx-scripts.sh b/linupx-scripts.sh index 5cf93af..1eabbc1 100755 --- a/linupx-scripts.sh +++ b/linupx-scripts.sh @@ -747,6 +747,24 @@ RECONFIGURE_NETWORK(){ [Nn]) ;; *) echo -en "${idsCL[LightCyan]}Making configuration changes ... ${idsCL[Default]}" + + if [ -f /etc/netplan/99-netcfg-* ]; then + rm -f /etc/netplan/*.yaml >/dev/null 2>&1 + mv /etc/netplan/eth0* /etc/netplan/eth0.yaml + if [ ! -f /etc/netplan/eth0.yaml ]; then + echo -e "network: + version: 2 + renderer: networkd + ethernets: + eth0: + dhcp4: no + addresses: [10.5.4.20/20] + gateway4: 10.5.1.1 + nameservers: + addresses: [10.10.10.10,10.10.10.11] +" > /etc/netplan/eth0.yaml + fi + fi hostnamectl set-hostname ${HOSTNAME} >/dev/null 2>&1 sed -i '/127.0.1.1/d' /etc/hosts >/dev/null 2>&1