V8.03.768.2025.06.18
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -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
|
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"
|
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
|
### SOURCING VARIABLES
|
||||||
[[ "${VAR_SETUP}" == true ]] && {
|
[[ "${VAR_SETUP}" == true ]] && {
|
||||||
. ./var/bash.var.sh
|
. ./var/bash.var.sh
|
||||||
@@ -73,8 +82,6 @@ declare -gx VAR_SETUP="true"
|
|||||||
. ./lib/lib_clean_screen.sh
|
. ./lib/lib_clean_screen.sh
|
||||||
. ./lib/lib_clean_up.sh
|
. ./lib/lib_clean_up.sh
|
||||||
. ./lib/lib_copy_integrity.sh
|
. ./lib/lib_copy_integrity.sh
|
||||||
. ./lib/lib_debug.sh
|
|
||||||
. ./lib/lib_debug_header.sh
|
|
||||||
. ./lib/lib_hardening_root_pw.sh
|
. ./lib/lib_hardening_root_pw.sh
|
||||||
. ./lib/lib_hardening_ssh.sh
|
. ./lib/lib_hardening_ssh.sh
|
||||||
. ./lib/lib_hardening_ultra.sh
|
. ./lib/lib_hardening_ultra.sh
|
||||||
@@ -90,29 +97,20 @@ declare -gx VAR_SETUP="true"
|
|||||||
. ./lib/lib_usage.sh
|
. ./lib/lib_usage.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
### VERY EARLY CHECK FOR XTRACE DEBUGGING
|
|
||||||
if [[ $* == *" --debug "* ]]; then
|
|
||||||
debugger "${@}"
|
|
||||||
else
|
|
||||||
declare -gx VAR_EARLY_DEBUG=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
### ADVISORY LOCK
|
### ADVISORY LOCK
|
||||||
exec 127>/var/lock/ciss_live_builder.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
|
printf "\e[91m❌ Cannot open lockfile for writing! Bye... \e[0m\n" >&2
|
||||||
exit "${ERR_FLOCK_WRTG}"
|
exit "${ERR_FLOCK_WRTG}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! flock -x -n 127; then
|
if ! flock -x -n 127; then
|
||||||
. ./var/global.var.sh
|
|
||||||
printf "\e[91m❌ Another instance is running! Bye...\e[0m\n" >&2
|
printf "\e[91m❌ Another instance is running! Bye...\e[0m\n" >&2
|
||||||
exit "${ERR_FLOCK_COLL}"
|
exit "${ERR_FLOCK_COLL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### VERY EARLY CHECK FOR AUTOBUILD MODE
|
### VERY EARLY CHECK FOR AUTOBUILD MODE
|
||||||
declare -gx VAR_HANDLER_AUTOBUILD=false
|
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
|
for arg in "$@"; do case "${arg,,}" in -a=*|--autobuild=*) declare -gx VAR_HANDLER_AUTOBUILD="true"; declare -gx VAR_KERNEL="${arg#*=}";; esac; done
|
||||||
unset arg
|
unset arg
|
||||||
for dir in /usr/local/sbin /usr/sbin; do case ":${PATH}:" in *":${dir}:"*) ;; *) PATH="${PATH}:${dir}" ;; esac; done; export PATH; unset dir
|
for dir in /usr/local/sbin /usr/sbin; do case ":${PATH}:" in *":${dir}:"*) ;; *) PATH="${PATH}:${dir}" ;; esac; done; export PATH; unset dir
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,6 @@ debugger() {
|
|||||||
### Open file descriptor 42 for writing to the debug log
|
### Open file descriptor 42 for writing to the debug log
|
||||||
exec 42>| "${LOG_DEBUG}"
|
exec 42>| "${LOG_DEBUG}"
|
||||||
### Write Debug Log Header https://www.gnu.org/software/bash/manual/html_node/Bash-Variables
|
### 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 "$#" "$*"
|
debug_header "$#" "$*"
|
||||||
### Tell Bash to send xtrace output to FD 42
|
### Tell Bash to send xtrace output to FD 42
|
||||||
export BASH_XTRACEFD=42
|
export BASH_XTRACEFD=42
|
||||||
|
|||||||
Reference in New Issue
Block a user