+++ /dev/null
-file_dot_variants() {
- for FILE in ${1}\.*; do
- if [ -f "${FILE}" ]; then
- . "${FILE}"
- fi
- done
-}
--- /dev/null
+file_dot_variants() {
+ for FILE in ${1}\.*; do
+ if [ -f "${FILE}" ]; then
+ . "${FILE}"
+ fi
+ done
+}
+++ /dev/null
-../../../../../scripts/lib/abort
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/abort.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/constants_user
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/constants_user.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/expect_n_args
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/expect_n_args.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/constants_seedbox
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/constants_seedbox.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/expected_rtorrent_files
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/expected_rtorrent_files.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/for_line_in
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/for_line_in.sh
\ No newline at end of file
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort_if_not_user
-. lib/constants_user
-. lib/prefixed_msg
-. lib/tagdir_parsing
+. lib/abort_if_not_user.sh
+. lib/constants_user.sh
+. lib/prefixed_msg.sh
+. lib/tagdir_parsing.sh
prefixed_msg_init
abort_if_not_user root
+++ /dev/null
-INSTALLER_VERSION=12.10.0
--- /dev/null
+INSTALLER_VERSION=12.10.0
+++ /dev/null
-. lib/prefixed_msg
-
-abort() {
- prefixed_msg "$1" >&2
- exit 1
-}
--- /dev/null
+. lib/prefixed_msg.sh
+
+abort() {
+ prefixed_msg "$1" >&2
+ exit 1
+}
+++ /dev/null
-. lib/abort
-
-abort_if_command_unknown() {
- if ! which "$1" > /dev/null; then
- abort "Expected command unavailable: ${1}."
- fi
-}
--- /dev/null
+. lib/abort.sh
+
+abort_if_command_unknown() {
+ if ! which "$1" > /dev/null; then
+ abort "Expected command unavailable: ${1}."
+ fi
+}
+++ /dev/null
-. lib/abort
-
-abort_if_not_user() {
- if [ "$(whoami)" != "$1" ]; then
- abort "Must be run as ${1}."
- fi
-}
--- /dev/null
+. lib/abort.sh
+
+abort_if_not_user() {
+ if [ "$(whoami)" != "$1" ]; then
+ abort "Must be run as ${1}."
+ fi
+}
+++ /dev/null
-. lib/for_line_in
-. lib/prefixed_msg
-
-apt_get_digested() {
-prefixed_msg_init 'apt_get_digested'
-
-local FINISH_LINE='apt_get_digested_FINISH_LINE'
-local SEDS=\
-'|\(Reading database \.\.\. .*|IGNORE
-|Generation complete.|IGNORE
-|Preconfiguring packages \.\.\.|IGNORE
-|Preparing to unpack [[:print:]]+ \.\.\.|IGNORE
-|Unpacking [[:print:]]+ \([[:print:]]+\)( over \([[:print:]]+\))? \.\.\.|IGNORE
-Adding diversion(s):|Adding '"'"'diversion of ([[:print:]]+) to ([[:print:]]+) by ([[:print:]]+)'"'"'| \3:[\1 → \2]
-Created symlink(s):|Created symlink '"'"'([[:print:]]+)'"'"' → '"'"'([[:print:]]+)'"'"'\.| [\1 → \2]
-FOLLOW_PREFIX|([[:print:]]+) depends on ([[:print:]]+)( \([>=]+ [[:print:]]+\))?\.|[\2 → \1]
-Installing new version of config file(s):|Installing new version of config file ([[:print:]]+) \.\.\.|\1
-Processing triggers for:|Processing triggers for ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
-Purging configuration files:|Purging configuration files for ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
-Removing:|Removing ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
-Removing diversion(s):|Removing '"'"'diversion of ([[:print:]]+) to ([[:print:]]+) by ([[:print:]]+)| \3:[\1 → \2]
-Removing obsolete conffile(s):|Removing obsolete conffile ([[:print:]]+) \.\.\.|\1
-Selecting previously unselected:|Selecting previously unselected package ([[:print:]]+)\.|\1
-Setting up:|Setting up ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
-Updating to current default:|Updating ([[:print:]]+) to current default.|\1
-disabled or static unit, so not starting:|([[:print:]]+) is a disabled or a static unit, not starting it\.|\1
-disabled or static unit not running, so not starting:|([[:print:]]+) is a disabled or a static unit not running, not starting it\.|\1
-BECOME_NEXT_PREFIX|dpkg: ([[:print:]]+): dependency problems, but removing anyway as you requested:|dpkg warns: removing \1 despite dependency problems:
-dpkg warns: unable to delete old directories (not empty):|dpkg: warning: unable to delete old directory '"'"'([[:print:]]+)'"'"': Directory not empty|\1
-update-alternatives: providing in auto mode:|update-alternatives: using ([[:print:]]+) to provide ([[:print:]]+) \(([[:print:]]+)\) in auto mode| [\1 → \2 (\3)]'
-
-print_nl_if_started_printing() {
- if [ -n "${STARTED_PRINTING}" ]; then
- printf '\n'
- fi
- printf '\r'
-}
-local LAST_PREFIX=''
-local STARTED_PRINTING=
-local LEADER_PREFIX=
-local APT_GET_EXIT_CODE=
-local APT_LINE=
-eval "set +e; DEBIAN_FRONTEND=noninteractive apt install -y $1; APT_GET_EXIT_CODE=\$?; set -e; echo ${FINISH_LINE} \${APT_GET_EXIT_CODE}" 2>&1 | while read APT_LINE; do
- APT_LINE=$(printf '%s' "${APT_LINE}" | tr -d '\r')
- if [ -z "${APT_LINE}" ]; then
- continue
- elif [ "$(echo ${APT_LINE} | cut -d' ' -f1)" = "${FINISH_LINE}" ]; then
- print_nl_if_started_printing
- local EXIT_CODE=$(echo ${APT_LINE} | cut -d' ' -f2)
- if [ "${EXIT_CODE}" != "0" ]; then
- false
- fi
- break
- fi
- local COMPRESSED_ITEM=''
- local PREFIX=
- try_seds() {
- local SED=$1
- PREFIX=$(printf '%s' "${SED}" | cut -d'|' -f1)
- local PATTERN=$(printf '^%s$' "${SED}" | cut -d'|' -f2)
- local REPLACEMENT=$(printf '%s' "${SED}" | cut -d'|' -f3)
- if printf '%s' "${APT_LINE}" | grep -E "${PATTERN}" > /dev/null; then
- COMPRESSED_ITEM=$(printf '%s' "${APT_LINE}" | sed -E "s|${PATTERN}|${REPLACEMENT}|")
- if [ "${PREFIX}" = "BECOME_NEXT_PREFIX" ]; then
- LEADER_PREFIX="${COMPRESSED_ITEM}"
- COMPRESSED_ITEM=IGNORE
- elif [ "${PREFIX}" = "FOLLOW_PREFIX" ]; then
- PREFIX="${LEADER_PREFIX}"
- fi
- break
- fi
- }
- for_line_in "${SEDS}" try_seds
- if [ "${COMPRESSED_ITEM}" = "IGNORE" ]; then
- continue
- elif [ -z "${COMPRESSED_ITEM}" ]; then
- print_nl_if_started_printing
- prefixed_msg_no_nl "${APT_LINE}"
- LAST_PREFIX=''
- else
- if [ "${PREFIX}" != "${LAST_PREFIX}" ]; then
- print_nl_if_started_printing
- prefixed_msg_no_nl "# ${PREFIX}"
- LAST_PREFIX="${PREFIX}"
- fi
- printf ' %s' "${COMPRESSED_ITEM}"
- fi
- STARTED_PRINTING=1
-done
-
-prefixed_msg_exit
-}
--- /dev/null
+. lib/for_line_in.sh
+. lib/prefixed_msg.sh
+
+apt_get_digested() {
+prefixed_msg_init 'apt_get_digested'
+
+local FINISH_LINE='apt_get_digested_FINISH_LINE'
+local SEDS=\
+'|\(Reading database \.\.\. .*|IGNORE
+|Generation complete.|IGNORE
+|Preconfiguring packages \.\.\.|IGNORE
+|Preparing to unpack [[:print:]]+ \.\.\.|IGNORE
+|Unpacking [[:print:]]+ \([[:print:]]+\)( over \([[:print:]]+\))? \.\.\.|IGNORE
+Adding diversion(s):|Adding '"'"'diversion of ([[:print:]]+) to ([[:print:]]+) by ([[:print:]]+)'"'"'| \3:[\1 → \2]
+Created symlink(s):|Created symlink '"'"'([[:print:]]+)'"'"' → '"'"'([[:print:]]+)'"'"'\.| [\1 → \2]
+FOLLOW_PREFIX|([[:print:]]+) depends on ([[:print:]]+)( \([>=]+ [[:print:]]+\))?\.|[\2 → \1]
+Installing new version of config file(s):|Installing new version of config file ([[:print:]]+) \.\.\.|\1
+Processing triggers for:|Processing triggers for ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
+Purging configuration files:|Purging configuration files for ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
+Removing:|Removing ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
+Removing diversion(s):|Removing '"'"'diversion of ([[:print:]]+) to ([[:print:]]+) by ([[:print:]]+)| \3:[\1 → \2]
+Removing obsolete conffile(s):|Removing obsolete conffile ([[:print:]]+) \.\.\.|\1
+Selecting previously unselected:|Selecting previously unselected package ([[:print:]]+)\.|\1
+Setting up:|Setting up ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1
+Updating to current default:|Updating ([[:print:]]+) to current default.|\1
+disabled or static unit, so not starting:|([[:print:]]+) is a disabled or a static unit, not starting it\.|\1
+disabled or static unit not running, so not starting:|([[:print:]]+) is a disabled or a static unit not running, not starting it\.|\1
+BECOME_NEXT_PREFIX|dpkg: ([[:print:]]+): dependency problems, but removing anyway as you requested:|dpkg warns: removing \1 despite dependency problems:
+dpkg warns: unable to delete old directories (not empty):|dpkg: warning: unable to delete old directory '"'"'([[:print:]]+)'"'"': Directory not empty|\1
+update-alternatives: providing in auto mode:|update-alternatives: using ([[:print:]]+) to provide ([[:print:]]+) \(([[:print:]]+)\) in auto mode| [\1 → \2 (\3)]'
+
+print_nl_if_started_printing() {
+ if [ -n "${STARTED_PRINTING}" ]; then
+ printf '\n'
+ fi
+ printf '\r'
+}
+local LAST_PREFIX=''
+local STARTED_PRINTING=
+local LEADER_PREFIX=
+local APT_GET_EXIT_CODE=
+local APT_LINE=
+eval "set +e; DEBIAN_FRONTEND=noninteractive apt install -y $1; APT_GET_EXIT_CODE=\$?; set -e; echo ${FINISH_LINE} \${APT_GET_EXIT_CODE}" 2>&1 | while read APT_LINE; do
+ APT_LINE=$(printf '%s' "${APT_LINE}" | tr -d '\r')
+ if [ -z "${APT_LINE}" ]; then
+ continue
+ elif [ "$(echo ${APT_LINE} | cut -d' ' -f1)" = "${FINISH_LINE}" ]; then
+ print_nl_if_started_printing
+ local EXIT_CODE=$(echo ${APT_LINE} | cut -d' ' -f2)
+ if [ "${EXIT_CODE}" != "0" ]; then
+ false
+ fi
+ break
+ fi
+ local COMPRESSED_ITEM=''
+ local PREFIX=
+ try_seds() {
+ local SED=$1
+ PREFIX=$(printf '%s' "${SED}" | cut -d'|' -f1)
+ local PATTERN=$(printf '^%s$' "${SED}" | cut -d'|' -f2)
+ local REPLACEMENT=$(printf '%s' "${SED}" | cut -d'|' -f3)
+ if printf '%s' "${APT_LINE}" | grep -E "${PATTERN}" > /dev/null; then
+ COMPRESSED_ITEM=$(printf '%s' "${APT_LINE}" | sed -E "s|${PATTERN}|${REPLACEMENT}|")
+ if [ "${PREFIX}" = "BECOME_NEXT_PREFIX" ]; then
+ LEADER_PREFIX="${COMPRESSED_ITEM}"
+ COMPRESSED_ITEM=IGNORE
+ elif [ "${PREFIX}" = "FOLLOW_PREFIX" ]; then
+ PREFIX="${LEADER_PREFIX}"
+ fi
+ break
+ fi
+ }
+ for_line_in "${SEDS}" try_seds
+ if [ "${COMPRESSED_ITEM}" = "IGNORE" ]; then
+ continue
+ elif [ -z "${COMPRESSED_ITEM}" ]; then
+ print_nl_if_started_printing
+ prefixed_msg_no_nl "${APT_LINE}"
+ LAST_PREFIX=''
+ else
+ if [ "${PREFIX}" != "${LAST_PREFIX}" ]; then
+ print_nl_if_started_printing
+ prefixed_msg_no_nl "# ${PREFIX}"
+ LAST_PREFIX="${PREFIX}"
+ fi
+ printf ' %s' "${COMPRESSED_ITEM}"
+ fi
+ STARTED_PRINTING=1
+done
+
+prefixed_msg_exit
+}
+++ /dev/null
-. lib/constants_finished
-
-check_finished_marker() {
- _PATH_MARKER="${PATH_ROOT_FINISHEDS}/$1"
- if [ ! -f "${_PATH_MARKER}" ]; then
- abort "Missing dependency, did not find marker: ${_PATH_MARKER}"
- fi
-}
--- /dev/null
+. lib/constants_finished.sh
+
+check_finished_marker() {
+ _PATH_MARKER="${PATH_ROOT_FINISHEDS}/$1"
+ if [ ! -f "${_PATH_MARKER}" ]; then
+ abort "Missing dependency, did not find marker: ${_PATH_MARKER}"
+ fi
+}
+++ /dev/null
-PATH_REL_ETC=etc
-PATH_ETC="/${PATH_REL_ETC}"
-
--- /dev/null
+PATH_REL_ETC=etc
+PATH_ETC="/${PATH_REL_ETC}"
+
+++ /dev/null
-PATH_ROOT_FINISHEDS=/root/.finished
--- /dev/null
+PATH_ROOT_FINISHEDS=/root/.finished
+++ /dev/null
-PATH_SCRIPTS="$(pwd)"
-PATH_CONF="$(dirname ${PATH_SCRIPTS})"
-PATH_CONF_HOME="${PATH_CONF}/home"
--- /dev/null
+PATH_SCRIPTS="$(pwd)"
+PATH_CONF="$(dirname ${PATH_SCRIPTS})"
+PATH_CONF_HOME="${PATH_CONF}/home"
+++ /dev/null
-EXT_TORRENT='.torrent'
-PATTERN_HASH_ONLY="^[A-Z0-9]{40}\$"
-DIRNAME_DOWNLOADS='downloads'
-DIRNAME_SESSION='session'
-PLACEHOLDER_HASH='????????????????????????????????????????'
-PLACEHOLDER_SIZE='????'
--- /dev/null
+EXT_TORRENT='.torrent'
+PATTERN_HASH_ONLY="^[A-Z0-9]{40}\$"
+DIRNAME_DOWNLOADS='downloads'
+DIRNAME_SESSION='session'
+PLACEHOLDER_HASH='????????????????????????????????????????'
+PLACEHOLDER_SIZE='????'
+++ /dev/null
-. lib/constants_user
-PATH_REL_SSH=.ssh
-PATH_USER_SSH="${PATH_USER_HOME}/${PATH_REL_SSH}"
--- /dev/null
+. lib/constants_user.sh
+PATH_REL_SSH=.ssh
+PATH_USER_SSH="${PATH_USER_HOME}/${PATH_REL_SSH}"
+++ /dev/null
-USERNAME=plom
-PATH_USER_HOME="/home/${USERNAME}"
--- /dev/null
+USERNAME=plom
+PATH_USER_HOME="/home/${USERNAME}"
+++ /dev/null
-. lib/tagdir_parsing
-
-copy_dirtrees_of_tags() {
- _copy_dirtree() {
- for _PATH_REL in $(tagdir_parsing__relpaths); do
- _FILENAME="$(basename ${_PATH_REL})"
- _PATH_TARGET_PARENT=/$(dirname "${_PATH_REL}")
-
- # ensure directory by mkdir -p; to avoid later chowning pre-existing directories,
- # collect only what's returned by the command as actually newly created
- _CREATION_SUMMARY=$(mkdir -pv "${_PATH_TARGET_PARENT}")
- _CREATED_PATHS=$(echo "${_CREATION_SUMMARY}" | sed -E "s/'\$//g" | sed -E "s/^mkdir: created directory '//g")
- _PATHS_WRITTEN="${_CREATED_PATHS}\n${_PATHS_WRITTEN}"
-
- # handle dirtree creation instruction files
- if tagdir_parsing__is_killme "${_FILENAME}"; then
- continue
- fi
- if tagdir_parsing__is_linkme "${_FILENAME}"; then
- _PARSED=$(tagdir_parsing__parse_linkme "${_PATH_REL}")
- _PATH_LINK=$(echo "${_PARSED}" | head -1)
- _LINK_TARGET=$(echo "${_PARSED}" | tail -1)
- ln -sf "${_LINK_TARGET}" "${_PATH_LINK}"
- _PATHS_WRITTEN="${_PATH_LINK}\n${_PATHS_WRITTEN}"
- continue
- fi
-
- # actual file copying
- _CREATION_SUMMARY=$(cp -avL "${_PATH_REL}" "${_PATH_TARGET_PARENT}")
- _CREATED_PATHS=$(echo "${_CREATION_SUMMARY}" | grep -v -E '^removed ' | sed -E "s/'\$//g" | sed "s/.*' -> '//g")
- _PATHS_WRITTEN="${_CREATED_PATHS}\n${_PATHS_WRITTEN}"
- done
- }
-
- _PATHS_WRITTEN=
- tagdir_parsing__for_tagdir '_copy_dirtree' $@
- _PATHS_WRITTEN=$(echo "${_PATHS_WRITTEN}" | grep -v -E '^ *$')
-
- ## for all paths written into user home directories, chown to respective users
- for _PATH in ${_PATHS_WRITTEN}; do
- if [ $(echo "${_PATH}" | grep -E '^/home/' | wc -l) -gt 0 ]; then
- _USERNAME=$(echo "${_PATH}" | sed -E 's/^\/home\///' | sed -E 's/\/.*//')
- chown -R "${_USERNAME}:${_USERNAME}" "${_PATH}"
- fi
- done
-}
--- /dev/null
+. lib/tagdir_parsing.sh
+
+copy_dirtrees_of_tags() {
+ _copy_dirtree() {
+ for _PATH_REL in $(tagdir_parsing__relpaths); do
+ _FILENAME="$(basename ${_PATH_REL})"
+ _PATH_TARGET_PARENT=/$(dirname "${_PATH_REL}")
+
+ # ensure directory by mkdir -p; to avoid later chowning pre-existing directories,
+ # collect only what's returned by the command as actually newly created
+ _CREATION_SUMMARY=$(mkdir -pv "${_PATH_TARGET_PARENT}")
+ _CREATED_PATHS=$(echo "${_CREATION_SUMMARY}" | sed -E "s/'\$//g" | sed -E "s/^mkdir: created directory '//g")
+ _PATHS_WRITTEN="${_CREATED_PATHS}\n${_PATHS_WRITTEN}"
+
+ # handle dirtree creation instruction files
+ if tagdir_parsing__is_killme "${_FILENAME}"; then
+ continue
+ fi
+ if tagdir_parsing__is_linkme "${_FILENAME}"; then
+ _PARSED=$(tagdir_parsing__parse_linkme "${_PATH_REL}")
+ _PATH_LINK=$(echo "${_PARSED}" | head -1)
+ _LINK_TARGET=$(echo "${_PARSED}" | tail -1)
+ ln -sf "${_LINK_TARGET}" "${_PATH_LINK}"
+ _PATHS_WRITTEN="${_PATH_LINK}\n${_PATHS_WRITTEN}"
+ continue
+ fi
+
+ # actual file copying
+ _CREATION_SUMMARY=$(cp -avL "${_PATH_REL}" "${_PATH_TARGET_PARENT}")
+ _CREATED_PATHS=$(echo "${_CREATION_SUMMARY}" | grep -v -E '^removed ' | sed -E "s/'\$//g" | sed "s/.*' -> '//g")
+ _PATHS_WRITTEN="${_CREATED_PATHS}\n${_PATHS_WRITTEN}"
+ done
+ }
+
+ _PATHS_WRITTEN=
+ tagdir_parsing__for_tagdir '_copy_dirtree' $@
+ _PATHS_WRITTEN=$(echo "${_PATHS_WRITTEN}" | grep -v -E '^ *$')
+
+ ## for all paths written into user home directories, chown to respective users
+ for _PATH in ${_PATHS_WRITTEN}; do
+ if [ $(echo "${_PATH}" | grep -E '^/home/' | wc -l) -gt 0 ]; then
+ _USERNAME=$(echo "${_PATH}" | sed -E 's/^\/home\///' | sed -E 's/\/.*//')
+ chown -R "${_USERNAME}:${_USERNAME}" "${_PATH}"
+ fi
+ done
+}
+++ /dev/null
-. lib/apt_get_digested
-. lib/constants_etc # PATH_ETC
-. lib/constants_user # USERNAME
-. lib/copy_dirtrees_of_tags
-. lib/prefixed_msg
-
-core_setup() {
-prefixed_msg_init 'core_setup'
-prefixed_msg 'starting (performing standard installation setup steps)'
-
-_HOSTNAME="$1"
-_FQDN="$2"
-_EXTERNAL_IP="$3"
-_INSTALL_TAGS="$4"
-
-./minimize_installation.sh ${_INSTALL_TAGS}
-
-prefixed_msg 'And now: dist-upgrade …'
-apt_get_digested '-q -q dist-upgrade'
-
-prefixed_msg "Setting up user: ${USERNAME}"
-adduser --quiet --disabled-password --gecos "" "${USERNAME}"
-usermod -a -G sudo "${USERNAME}"
-
-prefixed_msg 'Copying over files, directories …'
-copy_dirtrees_of_tags ${_INSTALL_TAGS}
-
-prefixed_msg 'Setting hostname …'
-hostnamectl hostname "${_HOSTNAME}"
-
-prefixed_msg "Adapting ${_PATH_HOSTS} …"
-_PATH_HOSTS="${PATH_ETC}/hosts"
-if [ -z "${_FQDN}" ]; then
- sed -i 's/REPLACE_WITH_FQDN/REPLACE_WITH_HOSTNAME.local REPLACE_WITH_HOSTNAME.localdomain/g' "${_PATH_HOSTS}"
-else
- sed -i 's/REPLACE_WITH_FQDN/'"${_FQDN}"'/g' "${_PATH_HOSTS}"
- sed -i "s/#REPLACE_WITH_EXTERNAL_IP/${_EXTERNAL_IP}/g" "${_PATH_HOSTS}"
-fi
-sed -i 's/REPLACE_WITH_HOSTNAME/'"${_HOSTNAME}"'/g' "${_PATH_HOSTS}"
-
-prefixed_msg 'Syncing clock …'
-ntpdate-debian -s
-
-prefixed_msg 'finished'
-prefixed_msg_exit
-}
--- /dev/null
+. lib/apt_get_digested.sh
+. lib/constants_etc.sh # PATH_ETC
+. lib/constants_user.sh # USERNAME
+. lib/copy_dirtrees_of_tags.sh
+. lib/prefixed_msg.sh
+
+core_setup() {
+prefixed_msg_init 'core_setup'
+prefixed_msg 'starting (performing standard installation setup steps)'
+
+_HOSTNAME="$1"
+_FQDN="$2"
+_EXTERNAL_IP="$3"
+_INSTALL_TAGS="$4"
+
+./minimize_installation.sh ${_INSTALL_TAGS}
+
+prefixed_msg 'And now: dist-upgrade …'
+apt_get_digested '-q -q dist-upgrade'
+
+prefixed_msg "Setting up user: ${USERNAME}"
+adduser --quiet --disabled-password --gecos "" "${USERNAME}"
+usermod -a -G sudo "${USERNAME}"
+
+prefixed_msg 'Copying over files, directories …'
+copy_dirtrees_of_tags ${_INSTALL_TAGS}
+
+prefixed_msg 'Setting hostname …'
+hostnamectl hostname "${_HOSTNAME}"
+
+prefixed_msg "Adapting ${_PATH_HOSTS} …"
+_PATH_HOSTS="${PATH_ETC}/hosts"
+if [ -z "${_FQDN}" ]; then
+ sed -i 's/REPLACE_WITH_FQDN/REPLACE_WITH_HOSTNAME.local REPLACE_WITH_HOSTNAME.localdomain/g' "${_PATH_HOSTS}"
+else
+ sed -i 's/REPLACE_WITH_FQDN/'"${_FQDN}"'/g' "${_PATH_HOSTS}"
+ sed -i "s/#REPLACE_WITH_EXTERNAL_IP/${_EXTERNAL_IP}/g" "${_PATH_HOSTS}"
+fi
+sed -i 's/REPLACE_WITH_HOSTNAME/'"${_HOSTNAME}"'/g' "${_PATH_HOSTS}"
+
+prefixed_msg 'Syncing clock …'
+ntpdate-debian -s
+
+prefixed_msg 'finished'
+prefixed_msg_exit
+}
+++ /dev/null
-. lib/apt_get_digested
-. lib/prefixed_msg
-
-ensure_packages_of_tags() {
-prefixed_msg_init 'ensure_packages_of_tags'
-
-_APT_ARG="-q -q -o 'Dpkg::Options::=--force-confnew' install"
-for _TAG in $@; do
- prefixed_msg_no_nl "For tag '${_TAG}', "
- if [ "$(echo ${_TAG} | cut -d':' -f1)" = 'keep_if_installed' ]; then
- _PACKAGE=$(echo ${_TAG} | cut -d':' -f2)
- printf 'checking if installed … '
- if dpkg-query -Wf '${Package}\n' | grep '^'"${_PACKAGE}"'$' > /dev/null; then
- echo 'yup, keeping!'
- apt_get_digested "${_APT_ARG} ${_PACKAGE}"
- else
- echo 'nope, nothing to keep.'
- fi
- continue
- fi
- _PATH_APTMARK_TAG="../aptmark/${_TAG}"
- if [ ! -f "${_PATH_APTMARK_TAG}" ]; then
- echo 'no file, ignoring.'
- continue
- fi
- _PACKAGES=$(cat "${_PATH_APTMARK_TAG}" | sed -E 's/#.*//g' | sed -z 's/\n/ /g' | sed 's/ */ /g' | cut -c 2-)
- if [ -z "${_PACKAGES}" ]; then
- echo 'nothing to install.'
- else
- echo "ensuring installation of: ${_PACKAGES}"
- apt_get_digested "${_APT_ARG} ${_PACKAGES}"
- fi
-done
-prefixed_msg_exit
-}
--- /dev/null
+. lib/apt_get_digested.sh
+. lib/prefixed_msg.sh
+
+ensure_packages_of_tags() {
+prefixed_msg_init 'ensure_packages_of_tags'
+
+_APT_ARG="-q -q -o 'Dpkg::Options::=--force-confnew' install"
+for _TAG in $@; do
+ prefixed_msg_no_nl "For tag '${_TAG}', "
+ if [ "$(echo ${_TAG} | cut -d':' -f1)" = 'keep_if_installed' ]; then
+ _PACKAGE=$(echo ${_TAG} | cut -d':' -f2)
+ printf 'checking if installed … '
+ if dpkg-query -Wf '${Package}\n' | grep '^'"${_PACKAGE}"'$' > /dev/null; then
+ echo 'yup, keeping!'
+ apt_get_digested "${_APT_ARG} ${_PACKAGE}"
+ else
+ echo 'nope, nothing to keep.'
+ fi
+ continue
+ fi
+ _PATH_APTMARK_TAG="../aptmark/${_TAG}"
+ if [ ! -f "${_PATH_APTMARK_TAG}" ]; then
+ echo 'no file, ignoring.'
+ continue
+ fi
+ _PACKAGES=$(cat "${_PATH_APTMARK_TAG}" | sed -E 's/#.*//g' | sed -z 's/\n/ /g' | sed 's/ */ /g' | cut -c 2-)
+ if [ -z "${_PACKAGES}" ]; then
+ echo 'nothing to install.'
+ else
+ echo "ensuring installation of: ${_PACKAGES}"
+ apt_get_digested "${_APT_ARG} ${_PACKAGES}"
+ fi
+done
+prefixed_msg_exit
+}
+++ /dev/null
-. lib/abort
-
-expect_n_args() {
- _N_MIN_ARGS="$1"
- _N_MAX_ARGS="$2"
- _USAGE="$3"
- shift 3
- _ABORT_MSG=
- if [ "$#" -lt "${_N_MIN_ARGS}" ]; then
- _ABORT_MSG="missing arguments (got $# instead of ${_N_MIN_ARGS})."
- elif [ "$#" -gt "${_N_MAX_ARGS}" ]; then
- shift "${_N_MAX_ARGS}"
- _ABORT_MSG="unexpected arguments beyond expected number (${_N_MAX_ARGS}): $@."
- fi
- if [ ! -z "${_ABORT_MSG}" ]; then
- if [ ! -z "${_USAGE}" ]; then
- _ABORT_MSG="${_ABORT_MSG} Expected arguments: ${_USAGE}"
- fi
- abort "Aborting due to ${_ABORT_MSG}"
- fi
-}
--- /dev/null
+. lib/abort.sh
+
+expect_n_args() {
+ _N_MIN_ARGS="$1"
+ _N_MAX_ARGS="$2"
+ _USAGE="$3"
+ shift 3
+ _ABORT_MSG=
+ if [ "$#" -lt "${_N_MIN_ARGS}" ]; then
+ _ABORT_MSG="missing arguments (got $# instead of ${_N_MIN_ARGS})."
+ elif [ "$#" -gt "${_N_MAX_ARGS}" ]; then
+ shift "${_N_MAX_ARGS}"
+ _ABORT_MSG="unexpected arguments beyond expected number (${_N_MAX_ARGS}): $@."
+ fi
+ if [ ! -z "${_ABORT_MSG}" ]; then
+ if [ ! -z "${_USAGE}" ]; then
+ _ABORT_MSG="${_ABORT_MSG} Expected arguments: ${_USAGE}"
+ fi
+ abort "Aborting due to ${_ABORT_MSG}"
+ fi
+}
+++ /dev/null
-expected_rtorrent_files() {
- local PATH_REL_TORRENT=$1
- local EXT
- for EXT in '' '.rtorrent' '.libtorrent_resume'; do
- if [ ! -f "${PATH_REL_TORRENT}${EXT}" ]; then
- return 1
- fi
- done
- return 0
-}
-
-
--- /dev/null
+expected_rtorrent_files() {
+ local PATH_REL_TORRENT=$1
+ local EXT
+ for EXT in '' '.rtorrent' '.libtorrent_resume'; do
+ if [ ! -f "${PATH_REL_TORRENT}${EXT}" ]; then
+ return 1
+ fi
+ done
+ return 0
+}
+
+
+++ /dev/null
-for_line_in() {
- local __LINES="$1"
- local __COMMAND="$2"
- local __OLD_IFS=${IFS}
- local IFS=$(printf '\n\r')
- local __LINE
- for __LINE in ${__LINES}; do
- IFS=${__OLD_IFS}
- ${__COMMAND} "${__LINE}"
- done
- IFS=${__OLD_IFS}
-}
--- /dev/null
+for_line_in() {
+ local __LINES="$1"
+ local __COMMAND="$2"
+ local __OLD_IFS=${IFS}
+ local IFS=$(printf '\n\r')
+ local __LINE
+ for __LINE in ${__LINES}; do
+ IFS=${__OLD_IFS}
+ ${__COMMAND} "${__LINE}"
+ done
+ IFS=${__OLD_IFS}
+}
+++ /dev/null
-. lib/copy_dirtrees_of_tags
-. lib/ensure_packages_of_tags
-. lib/prefixed_msg
-install_tags() {
- prefixed_msg_init 'install_tags'
-
- _INSTALL_TAGS="$@"
- prefixed_msg "Installing packages and files for: ${_INSTALL_TAGS}"
- ensure_packages_of_tags ${_INSTALL_TAGS}
- copy_dirtrees_of_tags ${_INSTALL_TAGS}
- prefixed_msg_exit
-}
--- /dev/null
+. lib/copy_dirtrees_of_tags.sh
+. lib/ensure_packages_of_tags.sh
+. lib/prefixed_msg.sh
+install_tags() {
+ prefixed_msg_init 'install_tags'
+
+ _INSTALL_TAGS="$@"
+ prefixed_msg "Installing packages and files for: ${_INSTALL_TAGS}"
+ ensure_packages_of_tags ${_INSTALL_TAGS}
+ copy_dirtrees_of_tags ${_INSTALL_TAGS}
+ prefixed_msg_exit
+}
+++ /dev/null
-prefixed_msg_init() {
- export prefixed_msg_OLD_PREFIX="${prefixed_msg_PREFIX}|${prefixed_msg_OLD_PREFIX}"
- if [ -z "$1" ]; then
- export prefixed_msg_PREFIX=$(basename "$0")
- else
- export prefixed_msg_PREFIX="$1"
- fi
-}
-
-prefixed_msg_exit() {
- export prefixed_msg_PREFIX=$(echo "${prefixed_msg_OLD_PREFIX}" | cut -d'|' -f1)
- export prefixed_msg_OLD_PREFIX=$(echo "${prefixed_msg_OLD_PREFIX}" | cut -d'|' -f2-)
-}
-
-
-
-prefixed_msg_no_nl() {
- if [ -z "${prefixed_msg_PREFIX}" ]; then
- printf '%s' "$1"
- return
- fi
- _INDENTOR='··'
- _INDENT=''
- _SEPARATORS=$(echo "${prefixed_msg_OLD_PREFIX}" | sed 's/[^|]//g')
- while [ ! -z "${_SEPARATORS}" ]; do
- _INDENT="${_INDENTOR}${_INDENT}"
- _SEPARATORS=$(echo -n "${_SEPARATORS}" | cut -d'|' -f2-)
- done
- printf '%s%s: %s' "${_INDENT}" "${prefixed_msg_PREFIX}" "$1"
-}
-
-prefixed_msg() {
- prefixed_msg_no_nl "$1"
- printf '\n'
-}
--- /dev/null
+prefixed_msg_init() {
+ export prefixed_msg_OLD_PREFIX="${prefixed_msg_PREFIX}|${prefixed_msg_OLD_PREFIX}"
+ if [ -z "$1" ]; then
+ export prefixed_msg_PREFIX=$(basename "$0")
+ else
+ export prefixed_msg_PREFIX="$1"
+ fi
+}
+
+prefixed_msg_exit() {
+ export prefixed_msg_PREFIX=$(echo "${prefixed_msg_OLD_PREFIX}" | cut -d'|' -f1)
+ export prefixed_msg_OLD_PREFIX=$(echo "${prefixed_msg_OLD_PREFIX}" | cut -d'|' -f2-)
+}
+
+
+
+prefixed_msg_no_nl() {
+ if [ -z "${prefixed_msg_PREFIX}" ]; then
+ printf '%s' "$1"
+ return
+ fi
+ _INDENTOR='··'
+ _INDENT=''
+ _SEPARATORS=$(echo "${prefixed_msg_OLD_PREFIX}" | sed 's/[^|]//g')
+ while [ ! -z "${_SEPARATORS}" ]; do
+ _INDENT="${_INDENTOR}${_INDENT}"
+ _SEPARATORS=$(echo -n "${_SEPARATORS}" | cut -d'|' -f2-)
+ done
+ printf '%s%s: %s' "${_INDENT}" "${prefixed_msg_PREFIX}" "$1"
+}
+
+prefixed_msg() {
+ prefixed_msg_no_nl "$1"
+ printf '\n'
+}
+++ /dev/null
-. lib/constants_finished
-. lib/prefixed_msg
-put_finished_marker() {
-
- prefixed_msg "Marking as finished: $1"
- mkdir -p "${PATH_ROOT_FINISHEDS}"
- touch "${PATH_ROOT_FINISHEDS}/$1"
-}
--- /dev/null
+. lib/constants_finished.sh
+. lib/prefixed_msg.sh
+put_finished_marker() {
+
+ prefixed_msg "Marking as finished: $1"
+ mkdir -p "${PATH_ROOT_FINISHEDS}"
+ touch "${PATH_ROOT_FINISHEDS}/$1"
+}
+++ /dev/null
-tagdir_parsing__is_killme() {
- test "$1" = 'KILL_ME'
-}
-
-tagdir_parsing__for_tagdir() {
- _COMMAND=$1
- shift 1
- _TAGS=$@
- for _TAG in ${_TAGS}; do
- _PATH_TAG="../copy/${_TAG}"
- if [ ! -d "${_PATH_TAG}" ]; then
- continue
- fi
- cd "${_PATH_TAG}"
- ${_COMMAND}
- cd - > /dev/null
- done
-}
-
-tagdir_parsing__relpaths() {
- find -L . -type f | cut -c 3-
-}
-
-tagdir_parsing__is_linkme() {
- echo "$1" | grep '^LINK_ME' > /dev/null
-}
-
-tagdir_parsing__parse_linkme() {
- _PATH_REL_LINKME=$1
- _PATH_REL_LINKME_PARENT=$(dirname "${_PATH_REL_LINKME}")
- _LINK_TARGET=$(cat "${_PATH_REL_LINKME}" | head -1)
- _LINK_NAME=$(cat "${_PATH_REL_LINKME}" | tail -1)
- if [ -z "${_LINK_NAME}" ]; then
- _LINK_NAME=$(basename "${_LINK_TARGET}")
- fi
- _PATH_ABS="/${_PATH_REL_LINKME_PARENT}/${_LINK_NAME}"
- printf '%s\n%s' "${_PATH_ABS}" "${_LINK_TARGET}"
-}
--- /dev/null
+tagdir_parsing__is_killme() {
+ test "$1" = 'KILL_ME'
+}
+
+tagdir_parsing__for_tagdir() {
+ _COMMAND=$1
+ shift 1
+ _TAGS=$@
+ for _TAG in ${_TAGS}; do
+ _PATH_TAG="../copy/${_TAG}"
+ if [ ! -d "${_PATH_TAG}" ]; then
+ continue
+ fi
+ cd "${_PATH_TAG}"
+ ${_COMMAND}
+ cd - > /dev/null
+ done
+}
+
+tagdir_parsing__relpaths() {
+ find -L . -type f | cut -c 3-
+}
+
+tagdir_parsing__is_linkme() {
+ echo "$1" | grep '^LINK_ME' > /dev/null
+}
+
+tagdir_parsing__parse_linkme() {
+ _PATH_REL_LINKME=$1
+ _PATH_REL_LINKME_PARENT=$(dirname "${_PATH_REL_LINKME}")
+ _LINK_TARGET=$(cat "${_PATH_REL_LINKME}" | head -1)
+ _LINK_NAME=$(cat "${_PATH_REL_LINKME}" | tail -1)
+ if [ -z "${_LINK_NAME}" ]; then
+ _LINK_NAME=$(basename "${_LINK_TARGET}")
+ fi
+ _PATH_ABS="/${_PATH_REL_LINKME_PARENT}/${_LINK_NAME}"
+ printf '%s\n%s' "${_PATH_ABS}" "${_LINK_TARGET}"
+}
+++ /dev/null
-trapp() {
- _COMMAND="$@"
- if [ -z "${_COMMAND}" ]; then
- _COMMAND='-'
- fi
- trap "${_COMMAND}" EXIT TERM HUP INT
-}
--- /dev/null
+trapp() {
+ _COMMAND="$@"
+ if [ -z "${_COMMAND}" ]; then
+ _COMMAND='-'
+ fi
+ trap "${_COMMAND}" EXIT TERM HUP INT
+}
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/apt_get_digested
-. lib/ensure_packages_of_tags
-. lib/prefixed_msg
+. lib/apt_get_digested.sh
+. lib/ensure_packages_of_tags.sh
+. lib/prefixed_msg.sh
prefixed_msg_init
_INSTALL_TAGS="$@"
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/check_finished_marker
-. lib/constants_user # PATH_USER_HOME
-. lib/expect_n_args
-. lib/install_tags
-. lib/prefixed_msg
+. lib/check_finished_marker.sh
+. lib/constants_user.sh # PATH_USER_HOME
+. lib/expect_n_args.sh
+. lib/install_tags.sh
+. lib/prefixed_msg.sh
prefixed_msg_init
prefixed_msg 'starting'
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/check_finished_marker
-. lib/expect_n_args
-. lib/install_tags
-. lib/prefixed_msg
+. lib/check_finished_marker.sh
+. lib/expect_n_args.sh
+. lib/install_tags.sh
+. lib/prefixed_msg.sh
prefixed_msg_init
prefixed_msg 'starting'
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/apt_get_digested
-. lib/constants_etc # PATH_ETC
-. lib/constants_ssh # PATH_REL_SSH, PATH_USER_SSH
-. lib/constants_user # USERNAME
-. lib/copy_dirtrees_of_tags
-. lib/core_setup
-. lib/expect_n_args
-. lib/prefixed_msg
-. lib/put_finished_marker
-. lib/trapp
+. lib/apt_get_digested.sh
+. lib/constants_etc.sh # PATH_ETC
+. lib/constants_ssh.sh # PATH_REL_SSH, PATH_USER_SSH
+. lib/constants_user.sh # USERNAME
+. lib/copy_dirtrees_of_tags.sh
+. lib/core_setup.sh
+. lib/expect_n_args.sh
+. lib/prefixed_msg.sh
+. lib/put_finished_marker.sh
+. lib/trapp.sh
prefixed_msg_init
prefixed_msg 'starting (setting up basics of standard server)'
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort_if_command_unknown
-. lib/constants_ssh # PATH_REL_SSH, PATH_USER_SSH
-. lib/expect_n_args
-. lib/path_tmp_timestamped
-. lib/prefixed_msg
-. lib/trapp
+. lib/abort_if_command_unknown.sh
+. lib/constants_ssh.sh # PATH_REL_SSH, PATH_USER_SSH
+. lib/expect_n_args.sh
+. lib/path_tmp_timestamped.sh
+. lib/prefixed_msg.sh
+. lib/trapp.sh
prefixed_msg_init 'init_server_access.sh'
prefixed_msg 'starting'
+++ /dev/null
-../../../trixie/scripts/lib/INSTALLER_VERSION
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/INSTALLER_VERSION.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/abort
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/abort.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/abort_if_command_unknown
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/abort_if_command_unknown.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/abort_if_exists
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/abort_if_exists.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/abort_if_not_user
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/abort_if_not_user.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/abort_if_offline
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/abort_if_offline.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/apt_get_digested
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/apt_get_digested.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/check_finished_marker
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/check_finished_marker.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_borg
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_borg.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_etc
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_etc.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_finished
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_finished.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_installer
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_installer.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_repopaths
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_repopaths.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_secrets
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_secrets.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_seedbox
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_seedbox.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_ssh
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_ssh.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/constants_user
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/constants_user.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/copy_and_unmount_secrets
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/copy_and_unmount_secrets.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/copy_dirtrees_of_tags
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/copy_dirtrees_of_tags.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/core_setup
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/core_setup.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/ensure_packages_of_tags
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/ensure_packages_of_tags.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/expect_n_args
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/expect_n_args.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/expected_rtorrent_files
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/expected_rtorrent_files.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/for_line_in
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/for_line_in.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/get_mountable_device_path
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/get_mountable_device_path.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/get_passphrase
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/get_passphrase.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/mount_secrets
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/mount_secrets.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/path_tmp_timestamped
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/path_tmp_timestamped.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/prefixed_msg
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/prefixed_msg.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/put_finished_marker
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/put_finished_marker.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/retry_until
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/retry_until.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/tagdir_parsing
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/tagdir_parsing.sh
\ No newline at end of file
+++ /dev/null
-../../../trixie/scripts/lib/trapp
\ No newline at end of file
--- /dev/null
+../../../trixie/scripts/lib/trapp.sh
\ No newline at end of file
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort_if_command_unknown
-. lib/abort_if_offline
-. lib/constants_ssh # PATH_USER_SSH
-. lib/expect_n_args
-. lib/path_tmp_timestamped
-. lib/prefixed_msg
-. lib/trapp
+. lib/abort_if_command_unknown.sh
+. lib/abort_if_offline.sh
+. lib/constants_ssh.sh # PATH_USER_SSH
+. lib/expect_n_args.sh
+. lib/path_tmp_timestamped.sh
+. lib/prefixed_msg.sh
+. lib/trapp.sh
prefixed_msg_init
#!/bin/sh
set -eC
cd $(dirname "$0")
-. lib/abort
-. lib/abort_if_exists
-. lib/abort_if_offline
-. lib/constants_seedbox
-. lib/expect_n_args
-. lib/expected_rtorrent_files
-. lib/for_line_in
-. lib/trapp
+. lib/abort.sh
+. lib/abort_if_exists.sh
+. lib/abort_if_offline.sh
+. lib/constants_seedbox.sh
+. lib/expect_n_args.sh
+. lib/expected_rtorrent_files.sh
+. lib/for_line_in.sh
+. lib/trapp.sh
cd - > /dev/null
DIRNAME_DOWNLOAD='download'
+++ /dev/null
-../../../../../scripts/lib/abort
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/abort.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/abort_if_exists
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/abort_if_exists.sh
\ No newline at end of file
+++ /dev/null
-audio_dev_is_mute() {
- _TYPE="$1"
- _IDX="$2"
- [ "$(pactl get-${_TYPE}-mute ${_IDX})" = "Mute: yes" ]
-}
--- /dev/null
+audio_dev_is_mute() {
+ _TYPE="$1"
+ _IDX="$2"
+ [ "$(pactl get-${_TYPE}-mute ${_IDX})" = "Mute: yes" ]
+}
+++ /dev/null
-../../../../../scripts/lib/constants_borg
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/constants_borg.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/constants_secrets
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/constants_secrets.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/constants_ssh
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/constants_ssh.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/constants_user
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/constants_user.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/copy_and_unmount_secrets
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/copy_and_unmount_secrets.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/expect_n_args
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/expect_n_args.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/get_passphrase
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/get_passphrase.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/mount_secrets
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/mount_secrets.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/path_tmp_timestamped
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/path_tmp_timestamped.sh
\ No newline at end of file
+++ /dev/null
-../../../../../scripts/lib/prefixed_msg
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/prefixed_msg.sh
\ No newline at end of file
+++ /dev/null
-print_usage() {
- echo 'Usage:'
- echo "${USAGE_LINES}" | while read _LINE; do
- echo " $(basename $0) ${_LINE}"
- done
- echo "\n${USAGE_DESCRIPTION}\n"
- _var_of() { eval printf '"%s"' '"${'"${1}${2}"'}"'; }
- _build_index() {
- _ARGS="$(_var_of 'USAGE_ARGS_' ${_IDX})"
- if [ ! -z "${_ARGS}" ]; then
- _ARGS=" ${_ARGS}"
- fi
- _NAME="${_IDX}"
- _ALT_NAME="$(_var_of 'USAGE_NAME_' ${_IDX})"
- if [ ! -z "${_ALT_NAME}" ]; then
- _NAME="${_ALT_NAME}"
- fi
- _KEY=" ${_NAME}${_ARGS}"
- }
- _MAX_LEN_KEY=0
- for _IDX in ${USAGE_INDICES}; do
- _build_index
- if [ ${#_KEY} -gt "${_MAX_LEN_KEY}" ]; then
- _MAX_LEN_KEY=${#_KEY}
- fi
- done
- for _IDX in ${USAGE_INDICES}; do
- _build_index
- printf '%s' "${_KEY}"
- _LEN_GAP=$(calc "${_MAX_LEN_KEY} - ${#_KEY} + 4")
- for _ in $(seq 1 ${_LEN_GAP}); do
- printf ' '
- done
- printf '%s\n' "$(_var_of 'USAGE_DESC_' ${_IDX})"
- done
-}
--- /dev/null
+print_usage() {
+ echo 'Usage:'
+ echo "${USAGE_LINES}" | while read _LINE; do
+ echo " $(basename $0) ${_LINE}"
+ done
+ echo "\n${USAGE_DESCRIPTION}\n"
+ _var_of() { eval printf '"%s"' '"${'"${1}${2}"'}"'; }
+ _build_index() {
+ _ARGS="$(_var_of 'USAGE_ARGS_' ${_IDX})"
+ if [ ! -z "${_ARGS}" ]; then
+ _ARGS=" ${_ARGS}"
+ fi
+ _NAME="${_IDX}"
+ _ALT_NAME="$(_var_of 'USAGE_NAME_' ${_IDX})"
+ if [ ! -z "${_ALT_NAME}" ]; then
+ _NAME="${_ALT_NAME}"
+ fi
+ _KEY=" ${_NAME}${_ARGS}"
+ }
+ _MAX_LEN_KEY=0
+ for _IDX in ${USAGE_INDICES}; do
+ _build_index
+ if [ ${#_KEY} -gt "${_MAX_LEN_KEY}" ]; then
+ _MAX_LEN_KEY=${#_KEY}
+ fi
+ done
+ for _IDX in ${USAGE_INDICES}; do
+ _build_index
+ printf '%s' "${_KEY}"
+ _LEN_GAP=$(calc "${_MAX_LEN_KEY} - ${#_KEY} + 4")
+ for _ in $(seq 1 ${_LEN_GAP}); do
+ printf ' '
+ done
+ printf '%s\n' "$(_var_of 'USAGE_DESC_' ${_IDX})"
+ done
+}
+++ /dev/null
-../../../../../scripts/lib/retry_until
\ No newline at end of file
--- /dev/null
+../../../../../scripts/lib/retry_until.sh
\ No newline at end of file
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort
+. lib/abort.sh
# . lib/abort_if_exists
-. lib/abort_if_not_user
-. lib/abort_if_offline
+. lib/abort_if_not_user.sh
+. lib/abort_if_offline.sh
# . lib/constants_secrets # PATH_SECRETS, PATH_SECRETS_KDBX, PATH_SECRETS_SSH, PATH_SECRETS_BORGKEYS, PATH_USER_KDBX
-. lib/constants_ssh # PATH_USER_SSH
-. lib/constants_user # USERNAME
+. lib/constants_ssh.sh # PATH_USER_SSH
+. lib/constants_user.sh # USERNAME
# . lib/constants_borg # NAME_BORGAPP
# . lib/copy_and_unmount_secrets
-. lib/expect_n_args
+. lib/expect_n_args.sh
# . lib/mount_secrets
-. lib/prefixed_msg
+. lib/prefixed_msg.sh
# . lib/retry_until
-. lib/trapp
+. lib/trapp.sh
prefixed_msg_init
PATH_REPOS="${HOME}/repos"
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort
-. lib/apt_get_digested
-. lib/constants_etc # PATH_ETC
-. lib/constants_releases # PREV_RELEASE, THIS_RELEASE
-. lib/expect_n_args
-. lib/prefixed_msg
-. lib/tagdir_parsing
+. lib/abort.sh
+. lib/apt_get_digested.sh
+. lib/constants_etc.sh # PATH_ETC
+. lib/constants_releases.sh # PREV_RELEASE, THIS_RELEASE
+. lib/expect_n_args.sh
+. lib/prefixed_msg.sh
+. lib/tagdir_parsing.sh
prefixed_msg_init
MSG_ALLOWED_INSTALLATION_TYPES='either "server" or "desktop"'
+++ /dev/null
-INSTALLER_VERSION=13.0.0
--- /dev/null
+INSTALLER_VERSION=13.0.0
+++ /dev/null
-../../../bookworm/scripts/lib/abort
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/abort.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/abort_if_command_unknown
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/abort_if_command_unknown.sh
\ No newline at end of file
+++ /dev/null
-. lib/abort
-
-abort_if_exists() {
- if [ -e "$1" ]; then
- abort "Aborting since $1 already exists."
- fi
-}
--- /dev/null
+. lib/abort.sh
+
+abort_if_exists() {
+ if [ -e "$1" ]; then
+ abort "Aborting since $1 already exists."
+ fi
+}
+++ /dev/null
-../../../bookworm/scripts/lib/abort_if_not_user
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/abort_if_not_user.sh
\ No newline at end of file
+++ /dev/null
-. lib/abort
-
-abort_if_offline() {
- if ! ping -c1 -W2 1.1.1.1 > /dev/null 2>&1; then
- abort 'Must be run online.'
- fi
-}
--- /dev/null
+. lib/abort.sh
+
+abort_if_offline() {
+ if ! ping -c1 -W2 1.1.1.1 > /dev/null 2>&1; then
+ abort 'Must be run online.'
+ fi
+}
+++ /dev/null
-../../../bookworm/scripts/lib/apt_get_digested
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/apt_get_digested.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/check_finished_marker
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/check_finished_marker.sh
\ No newline at end of file
+++ /dev/null
-NAME_BORGAPP=borgplom
-PATH_BORG_CONF="${HOME}/.config/borg"
--- /dev/null
+NAME_BORGAPP=borgplom
+PATH_BORG_CONF="${HOME}/.config/borg"
+++ /dev/null
-../../../bookworm/scripts/lib/constants_etc
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/constants_etc.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/constants_finished
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/constants_finished.sh
\ No newline at end of file
+++ /dev/null
-FILENAME_PRESEED_CFG=preseed.cfg
-PATH_PRESEED_CFG=$(realpath "../${FILENAME_PRESEED_CFG}")
--- /dev/null
+FILENAME_PRESEED_CFG=preseed.cfg
+PATH_PRESEED_CFG=$(realpath "../${FILENAME_PRESEED_CFG}")
+++ /dev/null
-PREV_RELEASE=bookworm
-THIS_RELEASE=trixie
--- /dev/null
+PREV_RELEASE=bookworm
+THIS_RELEASE=trixie
+++ /dev/null
-../../../bookworm/scripts/lib/constants_repopaths
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/constants_repopaths.sh
\ No newline at end of file
+++ /dev/null
-. lib/constants_user
-PATH_MEDIA=/media
-PATH_REL_SECRETS=.secrets
-PATH_SECRETS="${PATH_USER_HOME}/${PATH_REL_SECRETS}"
-PATH_SECRETS_SSH="${PATH_SECRETS}/ssh"
-PATH_SECRETS_BORGKEYS="${PATH_SECRETS}/borgkeys"
-FILENAME_KDBX=Passwords.kdbx
-PATH_SECRETS_KDBX="${PATH_SECRETS}/${FILENAME_KDBX}"
-PATH_USER_KDBX="${PATH_USER_HOME}/${FILENAME_KDBX}"
--- /dev/null
+. lib/constants_user.sh
+PATH_MEDIA=/media
+PATH_REL_SECRETS=.secrets
+PATH_SECRETS="${PATH_USER_HOME}/${PATH_REL_SECRETS}"
+PATH_SECRETS_SSH="${PATH_SECRETS}/ssh"
+PATH_SECRETS_BORGKEYS="${PATH_SECRETS}/borgkeys"
+FILENAME_KDBX=Passwords.kdbx
+PATH_SECRETS_KDBX="${PATH_SECRETS}/${FILENAME_KDBX}"
+PATH_USER_KDBX="${PATH_USER_HOME}/${FILENAME_KDBX}"
+++ /dev/null
-../../../bookworm/scripts/lib/constants_seedbox
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/constants_seedbox.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/constants_ssh
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/constants_ssh.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/constants_user
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/constants_user.sh
\ No newline at end of file
+++ /dev/null
-. lib/constants_secrets # PATH_REL_SECRETS, PATH_SECRETS
-
-copy_and_unmount_secrets() {
-prefixed_msg_init copy_and_unmount_secrets
-
-prefixed_msg "Copying over ${PATH_REL_SECRETS}."
-if [ "$1" = "out" ]; then
- cp -a "${PATH_SECRETS}" "${PATH_MOUNTED_SECRETS}"
-elif [ "$1" = "in" ]; then
- cp -a "${PATH_MOUNTED_SECRETS}" "${PATH_SECRETS}"
-else
- abort "Illegal argument to unmount_secrets."
-fi
-pumount "${SECRETS_DEV}"
-prefixed_msg "You can remove device ${SECRETS_DEV} now."
-
-prefixed_msg_exit
-}
--- /dev/null
+. lib/constants_secrets.sh # PATH_REL_SECRETS, PATH_SECRETS
+
+copy_and_unmount_secrets() {
+prefixed_msg_init copy_and_unmount_secrets
+
+prefixed_msg "Copying over ${PATH_REL_SECRETS}."
+if [ "$1" = "out" ]; then
+ cp -a "${PATH_SECRETS}" "${PATH_MOUNTED_SECRETS}"
+elif [ "$1" = "in" ]; then
+ cp -a "${PATH_MOUNTED_SECRETS}" "${PATH_SECRETS}"
+else
+ abort "Illegal argument to unmount_secrets."
+fi
+pumount "${SECRETS_DEV}"
+prefixed_msg "You can remove device ${SECRETS_DEV} now."
+
+prefixed_msg_exit
+}
+++ /dev/null
-../../../bookworm/scripts/lib/copy_dirtrees_of_tags
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/copy_dirtrees_of_tags.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/core_setup
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/core_setup.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/ensure_packages_of_tags
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/ensure_packages_of_tags.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/expect_n_args
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/expect_n_args.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/expected_rtorrent_files
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/expected_rtorrent_files.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/for_line_in
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/for_line_in.sh
\ No newline at end of file
+++ /dev/null
-. lib/abort
-
-get_mountable_device_path() {
- _PATH_DEV="/dev/$1"
- if [ ! -b "${_PATH_DEV}" ]; then
- abort "No block device at ${_PATH_DEV}."
- elif [ $(mount | grep -E "^${_PATH_DEV}" | wc -l) -gt 0 ]; then
- abort "${_PATH_DEV} already mounted."
- fi
- printf "${_PATH_DEV}"
-}
--- /dev/null
+. lib/abort.sh
+
+get_mountable_device_path() {
+ _PATH_DEV="/dev/$1"
+ if [ ! -b "${_PATH_DEV}" ]; then
+ abort "No block device at ${_PATH_DEV}."
+ elif [ $(mount | grep -E "^${_PATH_DEV}" | wc -l) -gt 0 ]; then
+ abort "${_PATH_DEV} already mounted."
+ fi
+ printf "${_PATH_DEV}"
+}
+++ /dev/null
-get_passphrase() {
- stty -echo
- read PASSPHRASE
- stty echo
- printf "${PASSPHRASE}"
-}
--- /dev/null
+get_passphrase() {
+ stty -echo
+ read PASSPHRASE
+ stty echo
+ printf "${PASSPHRASE}"
+}
+++ /dev/null
-../../../bookworm/scripts/lib/install_tags
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/install_tags.sh
\ No newline at end of file
+++ /dev/null
-. lib/constants_secrets # PATH_MEDIA, PATH_REL_SECRETS
-. lib/expect_n_args
-. lib/get_passphrase
-. lib/path_tmp_timestamped
-. lib/prefixed_msg
-. lib/retry_until
-
-mount_secrets() {
-prefixed_msg_init mount_secrets
-
-SECRETS_DEV=$1
-if [ -z "${SECRETS_DEV}" ]; then
- abort "Aborting due to empty device argument."
-fi
-PATH_MOUNTED_SECRETS="${PATH_MEDIA}/${SECRETS_DEV}/${PATH_REL_SECRETS}"
-PATH_DEV="/dev/${SECRETS_DEV}"
-PATH_PMOUNT_ERR="$(path_tmp_timestamped 'err_mount')"
-prefixed_msg "Put secrets drive into slot for ${PATH_DEV}."
-while [ ! -e "${PATH_DEV}" ]; do
- sleep 0.1
-done
-_ON_LOOP_START='prefixed_msg_no_nl "Passphrase: "; PASSPHRASE=$(get_passphrase); echo ""'
-_TO_TEST='echo "${PASSPHRASE}" | pmount "${PATH_DEV}" 2>&1'
-_ON_FAIL='prefixed_msg "Aborting due to pmount error:"'
-retry_until 100 "${_ON_LOOP_START}" "${_TO_TEST}" "${_ON_FAIL}"
-prefixed_msg "${_OUTPUT}"
-
-prefixed_msg_exit
-}
--- /dev/null
+. lib/constants_secrets.sh # PATH_MEDIA, PATH_REL_SECRETS
+. lib/expect_n_args.sh
+. lib/get_passphrase.sh
+. lib/path_tmp_timestamped.sh
+. lib/prefixed_msg.sh
+. lib/retry_until.sh
+
+mount_secrets() {
+prefixed_msg_init mount_secrets
+
+SECRETS_DEV=$1
+if [ -z "${SECRETS_DEV}" ]; then
+ abort "Aborting due to empty device argument."
+fi
+PATH_MOUNTED_SECRETS="${PATH_MEDIA}/${SECRETS_DEV}/${PATH_REL_SECRETS}"
+PATH_DEV="/dev/${SECRETS_DEV}"
+PATH_PMOUNT_ERR="$(path_tmp_timestamped 'err_mount')"
+prefixed_msg "Put secrets drive into slot for ${PATH_DEV}."
+while [ ! -e "${PATH_DEV}" ]; do
+ sleep 0.1
+done
+_ON_LOOP_START='prefixed_msg_no_nl "Passphrase: "; PASSPHRASE=$(get_passphrase); echo ""'
+_TO_TEST='echo "${PASSPHRASE}" | pmount "${PATH_DEV}" 2>&1'
+_ON_FAIL='prefixed_msg "Aborting due to pmount error:"'
+retry_until 100 "${_ON_LOOP_START}" "${_TO_TEST}" "${_ON_FAIL}"
+prefixed_msg "${_OUTPUT}"
+
+prefixed_msg_exit
+}
+++ /dev/null
-path_tmp_timestamped () {
- printf "/tmp/${1}_$(date +'%s')"
-}
--- /dev/null
+path_tmp_timestamped () {
+ printf "/tmp/${1}_$(date +'%s')"
+}
+++ /dev/null
-../../../bookworm/scripts/lib/prefixed_msg
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/prefixed_msg.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/put_finished_marker
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/put_finished_marker.sh
\ No newline at end of file
+++ /dev/null
-retry_until() {
- _CODE_FOR_CONTINUE="$1"
- _ON_LOOP_START="$2"
- _TO_TEST="$3"
- _ON_FAIL="$4"
- _ON_LOOP_END="$5"
- _OUTPUT_MODE="$6"
- while true; do
- eval "${_ON_LOOP_START}"
- set +e
- if [ "${_OUTPUT_MODE}" = 'direct' ]; then
- eval ${_TO_TEST}
- _RESULT=$?
- else
- _OUTPUT="$(eval ${_TO_TEST})"
- _RESULT=$?
- fi
- set -e
- if [ "${_RESULT}" = '0' ]; then
- break
- elif [ "${_RESULT}" != "${_CODE_FOR_CONTINUE}" ]; then
- eval "${_ON_FAIL}"
- abort
- fi
- eval "${_ON_LOOP_END}"
- done
-}
--- /dev/null
+retry_until() {
+ _CODE_FOR_CONTINUE="$1"
+ _ON_LOOP_START="$2"
+ _TO_TEST="$3"
+ _ON_FAIL="$4"
+ _ON_LOOP_END="$5"
+ _OUTPUT_MODE="$6"
+ while true; do
+ eval "${_ON_LOOP_START}"
+ set +e
+ if [ "${_OUTPUT_MODE}" = 'direct' ]; then
+ eval ${_TO_TEST}
+ _RESULT=$?
+ else
+ _OUTPUT="$(eval ${_TO_TEST})"
+ _RESULT=$?
+ fi
+ set -e
+ if [ "${_RESULT}" = '0' ]; then
+ break
+ elif [ "${_RESULT}" != "${_CODE_FOR_CONTINUE}" ]; then
+ eval "${_ON_FAIL}"
+ abort
+ fi
+ eval "${_ON_LOOP_END}"
+ done
+}
+++ /dev/null
-../../../bookworm/scripts/lib/tagdir_parsing
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/tagdir_parsing.sh
\ No newline at end of file
+++ /dev/null
-../../../bookworm/scripts/lib/trapp
\ No newline at end of file
--- /dev/null
+../../../bookworm/scripts/lib/trapp.sh
\ No newline at end of file
# based on <https://wiki.debian.org/DebianInstaller/WritableUSBStick>
set -eu
cd $(dirname "$0")
-. lib/INSTALLER_VERSION
-. lib/abort
-. lib/abort_if_command_unknown
-. lib/abort_if_not_user
-. lib/abort_if_offline
-. lib/constants_installer # FILENAME_PRESEED_CFG, PATH_PRESEED_CFG
-. lib/expect_n_args
-. lib/get_mountable_device_path
-. lib/path_tmp_timestamped
-. lib/trapp
+. lib/INSTALLER_VERSION.sh
+. lib/abort.sh
+. lib/abort_if_command_unknown.sh
+. lib/abort_if_not_user.sh
+. lib/abort_if_offline.sh
+. lib/constants_installer.sh # FILENAME_PRESEED_CFG, PATH_PRESEED_CFG
+. lib/expect_n_args.sh
+. lib/get_mountable_device_path.sh
+. lib/path_tmp_timestamped.sh
+. lib/trapp.sh
expect_n_args 1 2 'DEVICE (e.g. "sdb") [PATH_FILE_ISO]' $@
abort_if_not_user root
set -eu
ROOT=$(dirname "$0")
cd "${ROOT}"
-. lib/abort
-. lib/abort_if_offline
-. lib/apt_get_digested
-. lib/constants_etc # PATH_ETC
-. lib/constants_user # USERNAME
-. lib/copy_dirtrees_of_tags
-. lib/core_setup
-. lib/expect_n_args
-. lib/prefixed_msg
-. lib/put_finished_marker
+. lib/abort.sh
+. lib/abort_if_offline.sh
+. lib/apt_get_digested.sh
+. lib/constants_etc.sh # PATH_ETC
+. lib/constants_user.sh # USERNAME
+. lib/copy_dirtrees_of_tags.sh
+. lib/core_setup.sh
+. lib/expect_n_args.sh
+. lib/prefixed_msg.sh
+. lib/put_finished_marker.sh
prefixed_msg_init
prefixed_msg 'starting …'
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/apt_get_digested
-. lib/constants_ssh # PATH_REL_SSH, PATH_USER_SSH
-. lib/core_setup
-. lib/expect_n_args
-. lib/prefixed_msg
+. lib/apt_get_digested.sh
+. lib/constants_ssh.sh # PATH_REL_SSH, PATH_USER_SSH
+. lib/core_setup.sh
+. lib/expect_n_args.sh
+. lib/prefixed_msg.sh
prefixed_msg_init
prefixed_msg 'starting'
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort_if_not_user
-. lib/check_finished_marker
-. lib/constants_repopaths # PATH_CONF, PATH_SCRIPTS
-. lib/constants_user # USERNAME
-. lib/path_tmp_timestamped
-. lib/prefixed_msg
+. lib/abort_if_not_user.sh
+. lib/check_finished_marker.sh
+. lib/constants_repopaths.sh # PATH_CONF, PATH_SCRIPTS
+. lib/constants_user.sh # USERNAME
+. lib/path_tmp_timestamped.sh
+. lib/prefixed_msg.sh
prefixed_msg_init
#!/bin/sh
set -e
cd $(dirname "$0")
-. lib/abort_if_command_unknown
-. lib/constants_installer # FILENAME_PRESEED_CFG, PATH_PRESEED_CFG
-. lib/expect_n_args
-. lib/get_mountable_device_path
-. lib/prefixed_msg
-. lib/trapp
+. lib/abort_if_command_unknown.sh
+. lib/constants_installer.sh # FILENAME_PRESEED_CFG, PATH_PRESEED_CFG
+. lib/expect_n_args.sh
+. lib/get_mountable_device_path.sh
+. lib/prefixed_msg.sh
+. lib/trapp.sh
prefixed_msg_init