From 2731019dfb65f061d82244f68e9fba149e359083 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Fri, 18 Oct 2024 12:41:19 +0200 Subject: [PATCH] Updated xfr.pm (disabled NetworkManager boot time connection creating). --- .../c3d/firstboot/scripts/01_setupnetworking.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh b/sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh index 42694c1..13651f2 100755 --- a/sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh +++ b/sources/xfr.pm/c3d/firstboot/scripts/01_setupnetworking.sh @@ -34,6 +34,7 @@ while [ $CONNECTION_DEVICES_UP -lt 2 ] do if [ $CYCLES_WAITED -ge 10 ] then + echo nmcli connection show exit 1 fi @@ -56,20 +57,21 @@ then exit 1 fi -CONNECTION_LINE=$(nmcli --terse connection show | grep ':eth0$') +CONNECTION_DEVICE="eth0" +CONNECTION_ID="perimeter" +CONNECTION_LINE=$(nmcli --terse connection show | grep ":${CONNECTION_DEVICE}$") CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') -CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" nmcli connection add \ connection.autoconnect yes \ - connection.id perimeter \ + connection.id $CONNECTION_ID \ connection.interface-name $CONNECTION_DEVICE \ connection.type 802-3-ethernet \ ipv4.addresses "192.168.173.174/24" \ ipv4.dns "192.168.173.223" \ - ipv4.dns-search "pm.user.hu" \ + ipv4.dns-search "pm.useribm.hu" \ ipv4.gateway "192.168.173.254" \ ipv4.method "manual" \ ipv6.addresses "2001:1aa1:000a:7c0c:000c:18ff:fe03:adae/64" \ @@ -80,6 +82,13 @@ nmcli connection add \ ipv6.routes "2001:1aa1:000a:7dae::/64 2001:1aa1:000a:7c0c:000c:18ff:fe03:ad01" \ save yes +cat </etc/NetworkManager/conf.d/${CONNECTION_DEVICE}.conf +[device] +match-device=interface-name:$CONNECTION_DEVICE +allowed-connections=id:$CONNECTION_ID +keep-configuration=no +EOF + nmcli connection show hostnamectl hostname xfr.pm.useribm.hu -- 2.54.0