home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 16 Apr 2025 01:11:23 +0000 (03:11 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 16 Apr 2025 01:11:23 +0000 (03:11 +0200)
bookworm/scripts/lib/constants_repopaths
bookworm/scripts/lib/ensure_homefiles_of_tags
bookworm/scripts/lib/ensure_packages_of_tags
bookworm/scripts/lib/init_packages
bookworm/scripts/lib/setup_users
bookworm/scripts/setup_server.sh
testing/scripts/init_server_access.sh

index dc1353368b11e04bfc625dfcee5a2c163f7b0758..54bcb5f262e0cf839877a3f7bb5491e4251515ad 100644 (file)
@@ -1,2 +1,3 @@
 PATH_SCRIPTS="$(pwd)"
 PATH_CONF="$(dirname ${PATH_SCRIPTS})"
+PATH_CONF_HOME="${PATH_CONF}/home"
index 476695a2350de2781156d4422af37757e74ab723..72e8449e4ab07a662732ee5c5c14d9a818a05571 100644 (file)
@@ -1,8 +1,8 @@
 . lib/chown_to_user
 . lib/constants_user  # PATH_USER_HOME
-. lib/constants_repopaths  # PATH_CONF
+. lib/constants_repopaths  # PATH_CONF_HOME
 
 ensure_homefiles_of_tags() {
-    _TO_CHOWN=$(copy_dirtree "${_PATH_CONF_HOME}" "${PATH_USER_HOME}" $@ | sed "s/.*' -> //g")
+    _TO_CHOWN=$(copy_dirtree "${PATH_CONF_HOME}" "${PATH_USER_HOME}" $@ | sed "s/.*' -> //g")
     chown_to_user ${_TO_CHOWN}
 }
index 6e7f3f53357595f111618e37d8c231ebb66fa325..c43e54a76be2390f752c17a9d9041135a55fc314 100644 (file)
@@ -6,13 +6,13 @@ ensure_packages_of_tags() {
         if [ ! -f "${_PATH_APTMARK_TAG}" ]; then
             continue
         fi
-        printf 'Ensuring installation of: '
+        printf 'For tag "%s", ensuring installation of: ' "${_TAG}"
         cat "${_PATH_APTMARK_TAG}" | while read _LINE; do
             if [ ! $(echo "${_LINE}" | cut -c1) = "#" ]; then
                 echo -n "${_LINE} "
                 apt-get -y -o Dpkg::Options::="--force-confnew" install "${_LINE}" > /dev/null
             fi
         done
-        echo ''
+        echo '\n'
     done
 }
index 295a0fa1ced2e142489f8beb9dd04249bc0a3d22..e00c5a49ccd4a72906b9bdcc52a5fb89900d0e9b 100644 (file)
@@ -22,7 +22,7 @@ init_packages() {
     # before purging, ensure tagged packages installed
     ensure_packages_of_tags $@ 
     echo "Autoremove and purge …"
-    apt -y --purge autoremove > /dev/null
+    apt-get -y --purge autoremove > /dev/null
     echo "And now: dist-upgrade …"
-    apt -y dist-upgrade > /dev/null
+    apt-get -y dist-upgrade > /dev/null
 }
index 83488d6d43b1b5dddf1385f7148b4f61acee5e82..59df47fb913d4a290f3f1627d207a56970a55b59 100644 (file)
@@ -1,5 +1,6 @@
 . lib/chown_to_user
 . lib/copy_dirtree
+. lib/constants_repopaths  # PATH_CONF_HOME
 . lib/constants_user  # PATH_USER_HOME, USERNAME
 . lib/ensure_homefiles_of_tags
 . lib/mkdir_p_print_top
@@ -7,17 +8,16 @@
 setup_users() {
     _MIN_TAGS="$1"
     _TAGS_USER="$2"
-    _PATH_CONF_HOME=../home
     _PATH_USER_BIN="${PATH_USER_HOME}/.local/bin"
 
     echo "\nSetting up root user's home directory."
-    copy_dirtree "${_PATH_CONF_HOME}" '/root' ${_MIN_TAGS} root
+    copy_dirtree "${PATH_CONF_HOME}" '/root' ${_MIN_TAGS} root
 
     echo "\nSetting up user ${USERNAME}."
     adduser --disabled-password --gecos "" "${USERNAME}"
     usermod -a -G sudo "${USERNAME}"
     ensure_homefiles_of_tags ${_MIN_TAGS} ${_TAGS_USER}
-    copy_dirtree "${_PATH_CONF_HOME}" "${PATH_USER_HOME}" ${_MIN_TAGS} ${_TAGS_USER}
+    copy_dirtree "${PATH_CONF_HOME}" "${PATH_USER_HOME}" ${_MIN_TAGS} ${_TAGS_USER}
     _TO_CHOWN=$(mkdir_p_print_top "${_PATH_USER_BIN}")
     cd "${_PATH_USER_BIN}"
     ln -s ../../.plomlib lib
index a4c0a2d4b45cb5300ac41a41617162f5c7298681..191ffcdc7842ad4b2499fee88e35f5db59849d6a 100755 (executable)
@@ -23,9 +23,9 @@ PATH_CADDYFILE="${PATH_ETC}/caddy/Caddyfile"
 
 echo '\nPreparing caddy install.'
 PATH_CADDY_REPO='https://dl.cloudsmith.io/public/caddy/stable'
-apt -y install curl > /dev/null
+apt-get -y install curl > /dev/null
 curl -1Lf "${PATH_CADDY_REPO}/gpg.key" | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
-curl -1Lf "${PATH_CADDY_REPO}/debian.deb.txt" | tee /etc/apt/sources.list.d/caddy-stable.list
+curl -1Lf "${PATH_CADDY_REPO}/debian.deb.txt" > /etc/apt/sources.list.d/caddy-stable.list
 
 init_packages "${MIN_TAGS}"
 
index 90a3a4c7ea67b1bba7cdf50c5412cefa5ff2ea14..97ac66cdf3738e89fdb52401082bd0ce443743ee 100755 (executable)
@@ -17,6 +17,7 @@ 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
+    ssh-keyscan -v "${SERVER}"
     exit 1 
 fi
 set -e