From 190216439dccb4f676949c49cb3f72483437e847 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Wed, 19 Apr 2023 10:12:06 +0200 Subject: [PATCH] Updated pki.in (updated to Fedora 38). --- .../firstboot/scripts/01_setupnetworking.sh | 68 +++++++++++++------ sources/pki.in/envvars | 2 +- 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/sources/pki.in/c3d/firstboot/scripts/01_setupnetworking.sh b/sources/pki.in/c3d/firstboot/scripts/01_setupnetworking.sh index bfd1d99..4bb4b62 100755 --- a/sources/pki.in/c3d/firstboot/scripts/01_setupnetworking.sh +++ b/sources/pki.in/c3d/firstboot/scripts/01_setupnetworking.sh @@ -7,41 +7,66 @@ export PAGER= sleep 1 systemctl --quiet is-active NetworkManager.service NM_RC=$? -WAITED=0 +CYCLES_WAITED=0 while [ $NM_RC -ne 0 ] do + if [ $CYCLES_WAITED -ge 10 ] + then + exit 1 + fi + if [ $CYCLES_WAITED -eq 0 ] + then + echo -n "Waiting for NetworkManager" + fi echo -n . sleep 1 - WAITED=1 + CYCLES_WAITED=$(( $CYCLES_WAITED + 1 )) systemctl --quiet is-active NetworkManager.service NM_RC=$? done -[ $WAITED -eq 1 ] && echo +[ $CYCLES_WAITED -gt 0 ] && echo -CONNECTIONS=$(nmcli --terse connection show | wc -l) -while [ $CONNECTIONS -ne 1 ] +# wait for the two network connections to come up +CONNECTION_DEVICES_UP=$(nmcli --terse connection show \ + | grep --invert-match ':$' | wc -l) +CYCLES_WAITED=0 +while [ $CONNECTION_DEVICES_UP -lt 2 ] do - echo "Number of connections: $CONNECTIONS" >&2 + if [ $CYCLES_WAITED -ge 10 ] + then + nmcli connection show + exit 1 + fi + if [ $CYCLES_WAITED -eq 0 ] + then + echo -n "Waiting for the network connection" + fi + echo -n . sleep 1 - CONNECTIONS=$(nmcli --terse connection show | wc -l) + CYCLES_WAITED=$(( $CYCLES_WAITED + 1 )) + CONNECTION_DEVICES_UP=$(nmcli --terse connection show \ + | grep --invert-match ':$' | wc -l) done +[ $CYCLES_WAITED -gt 0 ] && echo -nmcli --terse connection show | grep ':$' >/dev/null -ALL_CONNECTION_DEVICES_KNOWN=$? -while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ] -do - echo "Not all connection devices are known yet" >&2 - sleep 1 - nmcli --terse connection show | grep ':$' >/dev/null - ALL_CONNECTION_DEVICES_KNOWN=$? -done +CONNECTIONS=$(nmcli --terse connection show | wc -l) +if [ $CONNECTIONS -ne 2 ] +then + echo "Number of connections: $CONNECTIONS instead of 2" >&2 + exit 1 +fi -CONNECTION_LINE=$(nmcli --terse connection show) +CONNECTION_LINE=$(nmcli --terse connection show | grep ':eth0$') CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':') CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':') nmcli connection delete uuid "$CONNECTION_UUID" +# ipv6.addresses "2a02:d400:0000:f268:000c:18ff:fe03:6dab/64" \ +# ipv6.dns "2a02:d400:0000:f268:000c:18ff:fe03:5c9f, 2a02:d400:0000:f268:000c:18ff:fe03:6d9f" \ +# ipv6.dns-search "in.useribm.hu" \ +# ipv6.gateway "2a02:d400:0000:f268:000c:18ff:fe03:6dfe" \ +# ipv6.method "manual" \ nmcli connection add \ connection.autoconnect yes \ connection.id internal \ @@ -52,11 +77,10 @@ nmcli connection add \ ipv4.dns-search "in.useribm.hu" \ ipv4.gateway "10.228.109.254" \ ipv4.method "manual" \ - ipv6.addresses "2a02:d400:0000:f268:000c:18ff:fe03:6dab/64" \ - ipv6.dns "2a02:d400:0000:f268:000c:18ff:fe03:5c9f, 2a02:d400:0000:f268:000c:18ff:fe03:6d9f" \ - ipv6.dns-search "in.useribm.hu" \ - ipv6.gateway "2a02:d400:0000:f268:000c:18ff:fe03:6dfe" \ - ipv6.method "manual" \ + ipv6.method "disabled" \ save yes nmcli connection show + +hostnamectl hostname pki.in.useribm.hu +hostnamectl diff --git a/sources/pki.in/envvars b/sources/pki.in/envvars index bad04c6..82405a2 100644 --- a/sources/pki.in/envvars +++ b/sources/pki.in/envvars @@ -1,3 +1,3 @@ DISTRIBUTION=Fedora -DISTRIBUTION_VERSION=37 +DISTRIBUTION_VERSION=38 SPEC_PACKAGES="certbot python3-certbot-dns-rfc2136 rsync-daemon vim-enhanced" -- 2.54.0