Updated ens.pm (updated to Fedora 38).
authorZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Sat, 20 May 2023 21:28:36 +0000 (23:28 +0200)
committerZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Sat, 20 May 2023 21:28:36 +0000 (23:28 +0200)
sources/ens.pm/c3d/firstboot/scripts/01_setupnetworking.sh
sources/ens.pm/c3d/firstboot/scripts/90_setupservices.sh [new file with mode: 0644]
sources/ens.pm/c3d/postinstall/scripts/10_setupservices.sh
sources/ens.pm/envvars

index d1e6e440afed2e1b3b88ceea2a5175e1a9dee094..00370c15f7b55bcceb3c1cd08346f94dbf9f6ddf 100755 (executable)
@@ -7,39 +7,67 @@ 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:f2ad:000c:18ff:fe03:ad40/64" \
+#    ipv6.dns "2a02:d400:0000:f2ad:000c:18ff:fe03:adae" \
+#    ipv6.dns-search "pm.useribm.hu" \
+#    ipv6.gateway "2a02:d400:0000:f2ad:000c:18ff:fe03:adfe" \
+#    ipv6.routes "2a02:d400:0000:f268::/64 2a02:d400:0000:f2ad:000c:18ff:fe03:ad01" \
+#    ipv6.method "manual" \
 nmcli connection add \
     connection.autoconnect yes \
     connection.id perimeter \
@@ -51,14 +79,10 @@ nmcli connection add \
     ipv4.gateway "192.168.173.254" \
     ipv4.method "manual" \
     ipv4.routes "10.228.0.0/16 192.168.173.1" \
-    ipv6.addresses "2a02:d400:0000:f2ad:000c:18ff:fe03:ad40/64" \
-    ipv6.dns "2a02:d400:0000:f2ad:000c:18ff:fe03:adae" \
-    ipv6.dns-search "pm.useribm.hu" \
-    ipv6.gateway "2a02:d400:0000:f2ad:000c:18ff:fe03:adfe" \
-    ipv6.routes "2a02:d400:0000:f268::/64 2a02:d400:0000:f2ad:000c:18ff:fe03:ad01" \
-    ipv6.method "manual" \
+    ipv6.method "disabled" \
     save yes
 
-nmcli connection delete uuid "$CONNECTION_UUID"
-
 nmcli connection show
+
+hostnamectl hostname pns.pm.useribm.hu
+hostnamectl
diff --git a/sources/ens.pm/c3d/firstboot/scripts/90_setupservices.sh b/sources/ens.pm/c3d/firstboot/scripts/90_setupservices.sh
new file mode 100644 (file)
index 0000000..d758570
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+
+systemctl enable named.service
+systemctl start named.service
+systemctl enable NetworkManager-wait-online.service
+systemctl start NetworkManager-wait-online.service
+
+systemctl enable logrotate.timer
+systemctl start logrotate.timer
index 41df693c7422d77500952c8fd66408ea37acd440..7241e78124a53a17800d4a98513097784d99577d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 
-systemctl enable named.service
-systemctl enable NetworkManager-wait-online.service
+systemctl disable named.service
+systemctl disable NetworkManager-wait-online.service
 
-systemctl enable logrotate.timer
+systemctl disable logrotate.timer
index 897d3d95704c3196be8430f789bf01017c262edb..cb1ec3eddf167ad23faf021870c9167f8e6ab321 100644 (file)
@@ -1,3 +1,3 @@
 DISTRIBUTION=Fedora
-DISTRIBUTION_VERSION=37
+DISTRIBUTION_VERSION=38
 SPEC_PACKAGES="bind bind-utils"