V8.13.048.2025.10.06
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -11,34 +11,69 @@
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
set -Ceuo pipefail
|
||||
declare -gx PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
declare -gx IFS=$' \t\n'
|
||||
umask 0077
|
||||
|
||||
printf "\e[95m++++ ++++ ++++ ++++ ++++ ++++ ++ 🧪 '%s' starting ... \e[0m\n" "${0}"
|
||||
install -d -m 0755 /run/lock
|
||||
exec 9> /run/lock/9000-cdi-starter.lock
|
||||
flock -n 9 || { echo "9000-cdi-starter already running. Exiting."; exit 0; }
|
||||
|
||||
[[ ! -d /root/.cdi/log ]] && mkdir -p /root/.cdi/log
|
||||
printf "CISS.debian.installer Master V8.13.048.2025.10.06 is up! \n" \
|
||||
>| /root/.cdi/log/boot_finished_"$(date +"%Y-%m-%d_%H-%M-%S")".log
|
||||
#######################################
|
||||
# Wait for network connectivity by looping.
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
net_wait() {
|
||||
declare -i i=1
|
||||
for i in {1..30}; do
|
||||
getent hosts git.coresecret.dev >/dev/null && break
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
cd /root/git
|
||||
#######################################
|
||||
# Main autostart function.
|
||||
# Arguments:
|
||||
# none
|
||||
#######################################
|
||||
main() {
|
||||
declare -r repo_url="https://git.coresecret.dev/msw/CISS.debian.installer.git"
|
||||
declare -r repo_dir="/root/git/CISS.debian.installer"
|
||||
|
||||
git clone https://git.coresecret.dev/msw/CISS.debian.installer.git
|
||||
install -d -m 0700 /root/.cdi/log
|
||||
# shellcheck disable=SC2155
|
||||
declare -r log="/root/.cdi/log/9000-cdi-starter_$(date +'%F_%H-%M-%S').log"
|
||||
# shellcheck disable=SC2312
|
||||
exec > >(tee -a "${log}") 2>&1
|
||||
|
||||
chmod 0700 /root/git/CISS.debian.installer/ciss_debian_installer.sh
|
||||
printf "CISS.debian.installer Master V8.13.048.2025.10.06 is up! \n" >| /root/.cdi/log/auto_start_begin_"$(date +"%Y-%m-%d_%H-%M-%S")".log
|
||||
|
||||
cd /root/git/CISS.debian.installer
|
||||
net_wait
|
||||
|
||||
#./ciss_debian_installer.sh \
|
||||
cd /root/git
|
||||
|
||||
[[ -d "${repo_dir}" ]] && rm -rf "${repo_dir}"
|
||||
|
||||
git clone --depth 1 "${repo_url}" "${repo_dir}"
|
||||
|
||||
chmod 0700 "${repo_dir}/ciss_debian_installer.sh"
|
||||
|
||||
cd "${repo_dir}"
|
||||
|
||||
#./ciss_debian_installer.sh \
|
||||
# --autoinstall \
|
||||
# --debug XTRACE \
|
||||
# --log debug \
|
||||
# --reionice-priority 1 0 \
|
||||
# --renice-priority "-19"
|
||||
|
||||
printf "CISS.debian.installer Master V8.13.048.2025.10.06 successfully executed! \n" \
|
||||
>| /root/.cdi/log/boot_finished_"$(date +"%Y-%m-%d_%H-%M-%S")".log
|
||||
printf "CISS.debian.installer Master V8.13.048.2025.10.06 successfully executed! \n" >| /root/.cdi/log/auto_start_finished_"$(date +"%Y-%m-%d_%H-%M-%S")".log
|
||||
|
||||
printf "\e[92m++++ ++++ ++++ ++++ ++++ ++++ ++ ✅ '%s' successfully applied. \e[0m\n" "${0}"
|
||||
exit 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f main
|
||||
|
||||
main "$@"
|
||||
|
||||
exit 0
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user