home · contact · privacy
Fix. master
authorChristian Heller <c.heller@plomlompom.de>
Wed, 16 Apr 2025 07:02:49 +0000 (09:02 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 16 Apr 2025 07:02:49 +0000 (09:02 +0200)
bookworm/scripts/lib/ensure_packages_of_tags
bookworm/scripts/lib/init_packages
bookworm/scripts/lib/path_tmp_timestamped [new file with mode: 0644]
bookworm/scripts/lib/put_finished_marker
bookworm/scripts/setup_server.sh
testing/scripts/lib/path_tmp_timestamped [changed from file to symlink]

index 92805321b108c72492f449a0e569683a8aa2cd40..e8f5a9d4209e54174e89b7c08fc0480c10689a5f 100644 (file)
@@ -6,10 +6,11 @@ ensure_packages_of_tags() {
         if [ ! -f "${_PATH_APTMARK_TAG}" ]; then
             continue
         fi
-        echo "For tag '"${_TAG}"', installing"
+        echo -n "For tag '${_TAG}', make sure this is installed: "
         cat "${_PATH_APTMARK_TAG}" | while read _LINE; do
             if [ ! $(echo "${_LINE}" | cut -c1) = "#" ]; then
-                apt-get -qq -y -o Dpkg::Options::="--force-confnew" install "${_LINE}"
+                echo -n "${_LINE} " 
+                apt-get -y -o Dpkg::Options::="--force-confnew" install "${_LINE}" > /dev/null
             fi
         done
         echo '\n'
index 5e65144bf39fb0e5163201e5352940fe81b69797..e00c5a49ccd4a72906b9bdcc52a5fb89900d0e9b 100644 (file)
@@ -22,7 +22,7 @@ init_packages() {
     # before purging, ensure tagged packages installed
     ensure_packages_of_tags $@ 
     echo "Autoremove and purge …"
-    apt-get -qqq -y --purge autoremove
+    apt-get -y --purge autoremove > /dev/null
     echo "And now: dist-upgrade …"
-    apt-get -qqq -y dist-upgrade
+    apt-get -y dist-upgrade > /dev/null
 }
diff --git a/bookworm/scripts/lib/path_tmp_timestamped b/bookworm/scripts/lib/path_tmp_timestamped
new file mode 100644 (file)
index 0000000..7ae63cd
--- /dev/null
@@ -0,0 +1,3 @@
+path_tmp_timestamped () {
+    printf "/tmp/${1}_$(date +'%s')"
+}
index 6c1f551182b05d5aaf3dcc198696e5728cd62347..351ef1a938cb89d50d6057a91bb9ec95d5570ba8 100644 (file)
@@ -1,6 +1,7 @@
 . lib/constants_finished
 
 put_finished_marker() {
+    echo "Marking as finished: $1"
     mkdir -p "${PATH_ROOT_FINISHEDS}" 
     touch "${PATH_ROOT_FINISHEDS}/$1"
 }
index ddfdcb179ed7324d9b35de0b1f574b0c91fa05df..d2beae003b1a5634ca1b4a4a1a48cc1b8513b85d 100755 (executable)
@@ -7,6 +7,7 @@ cd $(dirname "$0")
 . lib/ensure_etc_of_tags
 . lib/expect_n_args
 . lib/init_packages
+. lib/path_tmp_timestamped
 . lib/put_finished_marker
 . lib/setup_users
 
@@ -20,11 +21,19 @@ WEB_PASSWORD="$3"
 PATH_HOSTS="${PATH_ETC}/hosts"
 PATH_BORG_HOME=/home/borg
 PATH_CADDYFILE="${PATH_ETC}/caddy/Caddyfile"
+PATH_CADDY_REPO='https://dl.cloudsmith.io/public/caddy/stable'
 
 echo '\nPreparing caddy install.'
-PATH_CADDY_REPO='https://dl.cloudsmith.io/public/caddy/stable'
-apt-get -qq -y install curl
-curl -1Lf "${PATH_CADDY_REPO}/gpg.key" | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
+apt-get -y install curl > /dev/null
+PATH_CURL_ERROR="$(path_tmp_timestamped curl_error)"
+set +e
+curl -1Lf "${PATH_CADDY_REPO}/gpg.key" 2> "${PATH_CURL_ERROR}" | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
+RESULT="$?"
+set -e
+if [ "${RESULT}" != '0' ]; then
+    cat "${PATH_CURL_ERROR}"
+    exit 1
+fi
 curl -1Lf "${PATH_CADDY_REPO}/debian.deb.txt" > /etc/apt/sources.list.d/caddy-stable.list
 
 init_packages "${MIN_TAGS}"
deleted file mode 100644 (file)
index 7ae63cd5288127fbfc3d754d2d0ad3a1ef26fa8d..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,3 +0,0 @@
-path_tmp_timestamped () {
-    printf "/tmp/${1}_$(date +'%s')"
-}
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..2f17d83dc2b7496bde550b5236a0cfd5fdb30813
--- /dev/null
@@ -0,0 +1 @@
+../../../bookworm/scripts/lib/path_tmp_timestamped
\ No newline at end of file