Updated dhcp.in (converted to the new c3d format).
authorZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Fri, 11 Feb 2022 14:09:40 +0000 (15:09 +0100)
committerZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Fri, 11 Feb 2022 14:09:40 +0000 (15:09 +0100)
12 files changed:
scripts/poweroffall.sh [new file with mode: 0755]
sources/dhcp.in/c3d/firstboot/scripts/01_setupnetworking.sh [moved from sources/dhcp.in/firstboot/01_setupnetworking.sh with 100% similarity]
sources/dhcp.in/c3d/firstboot/scripts/02_settimezone.sh [moved from sources/dhcp.in/firstboot/02_settimezone.sh with 100% similarity]
sources/dhcp.in/c3d/firstboot/scripts/90_setupservices.sh [moved from sources/dhcp.in/firstboot/90_setupservices.sh with 100% similarity]
sources/dhcp.in/c3d/mode.txt [new file with mode: 0644]
sources/dhcp.in/c3d/postinstall/install-data/etc/dhcp/dhcpd.conf [moved from sources/dhcp.in/postinstall/install/etc/dhcp/dhcpd.conf with 100% similarity]
sources/dhcp.in/c3d/postinstall/scripts/10_setupservices.sh [moved from sources/dhcp.in/postinstall/10_setupservices.sh with 100% similarity]
sources/dhcp.in/firstboot/99_cleanup.sh [deleted file]
sources/dhcp.in/postinstall/01_setownership.sh [deleted file]
sources/dhcp.in/postinstall/02_setpermissions.sh [deleted file]
sources/dhcp.in/postinstall/03_installfiles.sh [deleted file]
sources/dhcp.in/postinstall/99_cleanup.sh [deleted file]

diff --git a/scripts/poweroffall.sh b/scripts/poweroffall.sh
new file mode 100755 (executable)
index 0000000..9af2adb
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+
+lxc-ls -1 --running | while read CONTAINER
+do
+    echo "Powering off $CONTAINER"
+    lxc-attach --name $CONTAINER -- poweroff
+done
similarity index 100%
rename from sources/dhcp.in/firstboot/01_setupnetworking.sh
rename to sources/dhcp.in/c3d/firstboot/scripts/01_setupnetworking.sh
index 3eb96878abfda34c9046d8ccb86e223e88a639ea..d265b543b802236935b6d3eb0b28edc1a78e5cc2 100755 (executable)
@@ -37,8 +37,6 @@ CONNECTION_LINE=$(nmcli --terse connection show)
 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 internal \
@@ -52,4 +50,6 @@ nmcli connection add \
     ipv6.method "disabled" \
     save yes
 
+nmcli connection delete uuid "$CONNECTION_UUID"
+
 nmcli connection show
diff --git a/sources/dhcp.in/c3d/mode.txt b/sources/dhcp.in/c3d/mode.txt
new file mode 100644 (file)
index 0000000..d0ff0b1
--- /dev/null
@@ -0,0 +1,3 @@
+# mode file (relative to /c3d)
+755 firstboot/scripts/*.sh
+755 postinstall/scripts/*.sh
diff --git a/sources/dhcp.in/firstboot/99_cleanup.sh b/sources/dhcp.in/firstboot/99_cleanup.sh
deleted file mode 100755 (executable)
index b87f2f4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-
-echo rm -Rf $REAL_PATH
diff --git a/sources/dhcp.in/postinstall/01_setownership.sh b/sources/dhcp.in/postinstall/01_setownership.sh
deleted file mode 100755 (executable)
index f2e6b94..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-SOURCE_PATH=$REAL_PATH/install
-
-chown -R root.root $SOURCE_PATH/*
diff --git a/sources/dhcp.in/postinstall/02_setpermissions.sh b/sources/dhcp.in/postinstall/02_setpermissions.sh
deleted file mode 100755 (executable)
index 241386a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-SOURCE_PATH=$REAL_PATH/install
diff --git a/sources/dhcp.in/postinstall/03_installfiles.sh b/sources/dhcp.in/postinstall/03_installfiles.sh
deleted file mode 100755 (executable)
index e4ee7ff..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-
-tar --create \
-    --directory=$REAL_PATH \
-    --exclude=.placeholder \
-    --to-stdout \
-    install \
-    | tar --extract \
-          --backup \
-          --directory=/ \
-          --no-overwrite-dir \
-          --strip-components=1 \
-          --suffix=.orig
diff --git a/sources/dhcp.in/postinstall/99_cleanup.sh b/sources/dhcp.in/postinstall/99_cleanup.sh
deleted file mode 100755 (executable)
index b87f2f4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-
-echo rm -Rf $REAL_PATH