From 2bfdf5fa42cf329c320cef277fb70d2f109fca992ea2d072578de8444f2fb1b3 Mon Sep 17 00:00:00 2001 From: "Marc S. Weidner" Date: Thu, 19 Jun 2025 07:27:27 +0200 Subject: [PATCH] V8.03.768.2025.06.18 Signed-off-by: Marc S. Weidner --- ciss_live_builder.sh | 24 +++++++++++------------- lib/lib_debug.sh | 6 ------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/ciss_live_builder.sh b/ciss_live_builder.sh index a41655a..359393a 100644 --- a/ciss_live_builder.sh +++ b/ciss_live_builder.sh @@ -49,6 +49,15 @@ for arg in "$@"; do case "${arg,,}" in -h|--help) . ./lib/lib_usage.sh; usage for arg in "$@"; do case "${arg,,}" in -v|--version) printf "\e[95mCISS.debian.live.builder Version: %s\e[0m\n" "${VAR_VERSION}"; exit 0;; esac; done declare -gx VAR_SETUP="true" +### VERY EARLY CHECK FOR XTRACE DEBUGGING +if [[ $* == *" --debug "* ]]; then + . ./lib/lib_debug.sh + . ./lib/lib_debug_header.sh + debugger "${@}" +else + declare -gx VAR_EARLY_DEBUG="false" +fi + ### SOURCING VARIABLES [[ "${VAR_SETUP}" == true ]] && { . ./var/bash.var.sh @@ -73,8 +82,6 @@ declare -gx VAR_SETUP="true" . ./lib/lib_clean_screen.sh . ./lib/lib_clean_up.sh . ./lib/lib_copy_integrity.sh - . ./lib/lib_debug.sh - . ./lib/lib_debug_header.sh . ./lib/lib_hardening_root_pw.sh . ./lib/lib_hardening_ssh.sh . ./lib/lib_hardening_ultra.sh @@ -90,29 +97,20 @@ declare -gx VAR_SETUP="true" . ./lib/lib_usage.sh } -### VERY EARLY CHECK FOR XTRACE DEBUGGING -if [[ $* == *" --debug "* ]]; then - debugger "${@}" -else - declare -gx VAR_EARLY_DEBUG=false -fi - ### ADVISORY LOCK exec 127>/var/lock/ciss_live_builder.lock || { - . ./var/global.var.sh printf "\e[91m❌ Cannot open lockfile for writing! Bye... \e[0m\n" >&2 exit "${ERR_FLOCK_WRTG}" } if ! flock -x -n 127; then - . ./var/global.var.sh printf "\e[91m❌ Another instance is running! Bye...\e[0m\n" >&2 exit "${ERR_FLOCK_COLL}" fi ### VERY EARLY CHECK FOR AUTOBUILD MODE -declare -gx VAR_HANDLER_AUTOBUILD=false -for arg in "$@"; do case "${arg,,}" in -a=*|--autobuild=*) declare -gx VAR_HANDLER_AUTOBUILD=true; declare -gx VAR_KERNEL="${arg#*=}";; esac; done +declare -gx VAR_HANDLER_AUTOBUILD="false" +for arg in "$@"; do case "${arg,,}" in -a=*|--autobuild=*) declare -gx VAR_HANDLER_AUTOBUILD="true"; declare -gx VAR_KERNEL="${arg#*=}";; esac; done unset arg for dir in /usr/local/sbin /usr/sbin; do case ":${PATH}:" in *":${dir}:"*) ;; *) PATH="${PATH}:${dir}" ;; esac; done; export PATH; unset dir diff --git a/lib/lib_debug.sh b/lib/lib_debug.sh index c66a13d..0790f3c 100644 --- a/lib/lib_debug.sh +++ b/lib/lib_debug.sh @@ -44,12 +44,6 @@ debugger() { ### Open file descriptor 42 for writing to the debug log exec 42>| "${LOG_DEBUG}" ### Write Debug Log Header https://www.gnu.org/software/bash/manual/html_node/Bash-Variables - ### Determine the directory of this script, even if sourced. - # shellcheck disable=SC2155 - declare script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - ### Source the header from the same directory. This ensures we always load lib/lib_debug_header.sh correctly. - . "${script_dir}/lib_debug_header.sh" - # shellcheck disable=SC2119 debug_header "$#" "$*" ### Tell Bash to send xtrace output to FD 42 export BASH_XTRACEFD=42