From: Christian Heller Date: Wed, 16 Apr 2025 07:02:49 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bprefix%7D%7D/new_day?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=config Fix. --- diff --git a/bookworm/scripts/lib/ensure_packages_of_tags b/bookworm/scripts/lib/ensure_packages_of_tags index 9280532..e8f5a9d 100644 --- a/bookworm/scripts/lib/ensure_packages_of_tags +++ b/bookworm/scripts/lib/ensure_packages_of_tags @@ -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' diff --git a/bookworm/scripts/lib/init_packages b/bookworm/scripts/lib/init_packages index 5e65144..e00c5a4 100644 --- a/bookworm/scripts/lib/init_packages +++ b/bookworm/scripts/lib/init_packages @@ -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 index 0000000..7ae63cd --- /dev/null +++ b/bookworm/scripts/lib/path_tmp_timestamped @@ -0,0 +1,3 @@ +path_tmp_timestamped () { + printf "/tmp/${1}_$(date +'%s')" +} diff --git a/bookworm/scripts/lib/put_finished_marker b/bookworm/scripts/lib/put_finished_marker index 6c1f551..351ef1a 100644 --- a/bookworm/scripts/lib/put_finished_marker +++ b/bookworm/scripts/lib/put_finished_marker @@ -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" } diff --git a/bookworm/scripts/setup_server.sh b/bookworm/scripts/setup_server.sh index ddfdcb1..d2beae0 100755 --- a/bookworm/scripts/setup_server.sh +++ b/bookworm/scripts/setup_server.sh @@ -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}" diff --git a/testing/scripts/lib/path_tmp_timestamped b/testing/scripts/lib/path_tmp_timestamped deleted file mode 100644 index 7ae63cd..0000000 --- a/testing/scripts/lib/path_tmp_timestamped +++ /dev/null @@ -1,3 +0,0 @@ -path_tmp_timestamped () { - printf "/tmp/${1}_$(date +'%s')" -} diff --git a/testing/scripts/lib/path_tmp_timestamped b/testing/scripts/lib/path_tmp_timestamped new file mode 120000 index 0000000..2f17d83 --- /dev/null +++ b/testing/scripts/lib/path_tmp_timestamped @@ -0,0 +1 @@ +../../../bookworm/scripts/lib/path_tmp_timestamped \ No newline at end of file