From: Christian Heller Date: Wed, 16 Apr 2025 05:28:41 +0000 (+0200) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%22https:/validator.w3.org/tasks?a=commitdiff_plain;h=babf4967c1f4715d56dde616e3d99750ab4c6544;p=config Fix. --- diff --git a/bookworm/scripts/lib/copy_dirtree b/bookworm/scripts/lib/copy_dirtree index 5c7a227..7a3a173 100644 --- a/bookworm/scripts/lib/copy_dirtree +++ b/bookworm/scripts/lib/copy_dirtree @@ -15,7 +15,7 @@ copy_dirtree() { fi cd "${_PATH_TAG}" for _PATH_REL in $(find . -type f,l); do - _PATH_TARGET="${_TARGET_ROOT}"$(echo "${_PATH_REL}" | cut -c2-) + _PATH_TARGET="${_TARGET_ROOT}"$(echo "${_PATH_REL}" | cut -c 2-) _PATH_SOURCE=$(realpath "${_PATH_REL}") _DIRECTORY=$(dirname "${_PATH_TARGET}") if [ ! -z "${_OWNER}" ]; then diff --git a/bookworm/scripts/lib/ensure_packages_of_tags b/bookworm/scripts/lib/ensure_packages_of_tags index c79b1f0..9280532 100644 --- a/bookworm/scripts/lib/ensure_packages_of_tags +++ b/bookworm/scripts/lib/ensure_packages_of_tags @@ -9,7 +9,7 @@ ensure_packages_of_tags() { echo "For tag '"${_TAG}"', installing" cat "${_PATH_APTMARK_TAG}" | while read _LINE; do if [ ! $(echo "${_LINE}" | cut -c1) = "#" ]; then - apt-get -q -y -o Dpkg::Options::="--force-confnew" install "${_LINE}" + apt-get -qq -y -o Dpkg::Options::="--force-confnew" install "${_LINE}" fi done echo '\n' diff --git a/bookworm/scripts/lib/init_packages b/bookworm/scripts/lib/init_packages index b77dfc1..5e65144 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 -qq -y --purge autoremove + apt-get -qqq -y --purge autoremove echo "And now: dist-upgrade …" - apt-get -qq -y dist-upgrade + apt-get -qqq -y dist-upgrade } diff --git a/bookworm/scripts/lib/mkdir_p_for_user b/bookworm/scripts/lib/mkdir_p_for_user index 0fde79a..ad0e4a9 100644 --- a/bookworm/scripts/lib/mkdir_p_for_user +++ b/bookworm/scripts/lib/mkdir_p_for_user @@ -1,7 +1,7 @@ mkdir_p_for_user() { _USER="$1" - _TO_SHORTEN=$(mkdir -pv "$1" | sed "s/mkdir: created directory '//g" | head -1) - if [ -z "${_TO_SHORTEN}" ]; then + _TO_SHORTEN=$(mkdir -pv "$2" | sed "s/mkdir: created directory '//g" | head -1) + if [ ! -z "${_TO_SHORTEN}" ]; then _LENGTH=$(echo -n "${_TO_SHORTEN}" | wc -c) _TARGET_LENGTH=$(calc "${_LENGTH} - 1" | cut -f2) _TARGET_DIR=$(echo "${_TO_SHORTEN}" | cut -c "-${_TARGET_LENGTH}") diff --git a/testing/scripts/init_server_access.sh b/testing/scripts/init_server_access.sh index 97ac66c..54332b6 100755 --- a/testing/scripts/init_server_access.sh +++ b/testing/scripts/init_server_access.sh @@ -1,6 +1,5 @@ #!/bin/sh set -e -set -x cd $(dirname "$0") . lib/constants_ssh # PATH_USER_SSH . lib/expect_min_n_args @@ -15,8 +14,8 @@ set +e ssh-keygen -f "${PATH_KNOWN_HOSTS}" -R "${SERVER}" ssh-keyscan "${SERVER}" >> "${PATH_KNOWN_HOSTS}" RESULT=$? -echo "DEBUG (why does script sometimes stop here if 'set -e' a bit earlier?): ${RESULT}" if [ "${RESULT}" != "0" ]; then + echo "ERROR: For some reason ssh-keyscan returned non-zero exit code, here's what a re-run with -v looks like:" ssh-keyscan -v "${SERVER}" exit 1 fi @@ -28,6 +27,6 @@ ssh "root@${SERVER}" 'printf "\n\n" && passwd' stty echo echo '\nSetting up config repo.' -ssh "root@${SERVER}" 'apt update && apt install -y git && git clone https://plomlompom.com/repos/clone/config' +ssh "root@${SERVER}" 'apt-get -q update && apt-get -q -y install git && git clone https://plomlompom.com/repos/clone/config' echo "\nServer ready, log in with: ssh root@${SERVER}"