V8.13.432.2025.11.18
All checks were successful
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Successful in 1m2s
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m14s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-11-18 10:35:01 +00:00
parent 4b2362d6a2
commit a57cac41a5
42 changed files with 98 additions and 66 deletions

View File

@@ -70,16 +70,21 @@ readonly -f cdi
#######################################
net_wait() {
### Declare Arrays, HashMaps, and Variables.
declare -i i=1
declare -i i
for i in {1..60}; do
for ((i=1; i<=60; i++)); do
if getent hosts git.coresecret.dev >/dev/null 2>&1; then
return 0
fi
getent hosts git.coresecret.dev >/dev/null && break
sleep 1
done
return 0
return 1
}
### Prevents accidental 'unset -f'.
# shellcheck disable=SC2034
@@ -98,7 +103,7 @@ sysp() {
sysctl -p /etc/sysctl.d/99_local.hardened
# shellcheck disable=SC2312
sysctl -a | grep -E 'kernel|vm|net' >| /var/log/sysctl_check"$(date +"%Y-%m-%d_%H:%M:%S")".log
sysctl -a | grep -E '^(kernel|vm|net)\.' >| "/var/log/sysctl_check_$(date +'%Y-%m-%d_%H-%M-%S').log"
return 0
}
@@ -124,10 +129,8 @@ main() {
var_log="/root/.ciss/cdi/log/9999-cdi-starter_$(date +"%Y-%m-%d_%H-%M-%S").log"
touch "${var_log}"
# shellcheck disable=SC2312
exec > >(tee -a "${var_log}") 2>&1
printf "CISS.debian.installer Master V8.13.416.2025.11.17 is up! \n" >> "${var_log}"
printf "CISS.debian.installer Master V8.13.432.2025.11.18 is up! \n" >> "${var_log}"
### Sleep a moment to settle boot artifacts.
sleep 8
@@ -139,16 +142,39 @@ main() {
### Wait for network connectivity.
printf "Command: [net_wait] to be executed ... \n" >> "${var_log}"
net_wait
# shellcheck disable=SC2310
if ! net_wait; then
logger -t cdi-watcher "Network/DNS not available after 60s; skipping online bootstrap."
printf "Command: [net_wait] no DNS/network after 60s; skipping apt/git bootstrap.\n" >> "${var_log}"
### Do not mark the service as failed when the system is simply offline.
exit 0
fi
printf "Command: [net_wait] executed.\n" >> "${var_log}"
### apt update.
apt-get update >> "${var_log}"
if ! apt-get update >> "${var_log}"; then
logger -t cdi-watcher "apt-get update failed; continuing without package refresh."
printf "Command: [apt-get update] failed; continuing without package refresh.\n" >> "${var_log}"
fi
### Download CISS.debian.installer.
install -d -m 0700 /root/git
cd /root/git
[[ -d "${var_repo_dir}" ]] && rm -rf "${var_repo_dir}"
git clone "${var_repo_url}" "${var_repo_dir}"
if ! git clone "${var_repo_url}" "${var_repo_dir}"; then
logger -t cdi-watcher "git clone of ${var_repo_url} failed; aborting CDI autostart."
printf "Command: [git clone %s %s] failed; aborting CDI autostart.\n" "${var_repo_url}" "${var_repo_dir}" >> "${var_log}"
exit 0
fi
chmod 0700 "${var_repo_dir}/ciss_debian_installer.sh"
cd "${var_repo_dir}"
printf "Command: [git clone %s %s] executed.\n" "${var_repo_url}" "${var_repo_dir}" >> "${var_log}"
@@ -171,7 +197,7 @@ main() {
else
logger -t cdi-watcher "Semaphore ${VAR_SEMAPHORE} present but wrong mode ${var_mode} (expected 600); ignoring"
printf "INFO: [Semaphore %s present but wrong mode %s (expected 600); ignoring] executed.\n" "${VAR_SEMAPHORE}}" "${var_mode}}" >> "${var_log}"
printf "INFO: [Semaphore %s present but wrong mode %s (expected 600); ignoring] executed.\n" "${VAR_SEMAPHORE}" "${var_mode}" >> "${var_log}"
fi
@@ -183,7 +209,7 @@ main() {
### Timeout reached without acceptable semaphore.
logger -t cdi-watcher "No valid semaphore ${VAR_SEMAPHORE} (mode 0600) within ${VAR_TIMEOUT}s; exiting idle."
printf "CISS.debian.installer Master V8.13.416.2025.11.17: No valid semaphore [%s] within [%s]s.\n" "${VAR_SEMAPHORE}" "${VAR_TIMEOUT}" >> "${var_log}"
printf "CISS.debian.installer Master V8.13.432.2025.11.18: No valid semaphore [%s] within [%s]s.\n" "${VAR_SEMAPHORE}" "${VAR_TIMEOUT}" >> "${var_log}"
exit 0
}