V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 38s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-07-22 23:47:10 +02:00
parent ffa6d6230b
commit 328e346c95
15 changed files with 185 additions and 184 deletions

View File

@@ -53,7 +53,7 @@ print_file_err() {
printf "❌ Arguments Counter : %s %s" "${ARGUMENTS_COUNT}" "${NL}"
printf "❌ Arguments Original : %s %s" "${ARG_STR_ORG_INPUT}" "${NL}"
printf "❌ Arguments Sanitized : %s %s" "${VAR_ARG_SANITIZED}" "${NL}"
if [[ "${VAR_DEBUG_TRACE}" || "${VAR_DEBUG_TRAP}" ]]; then
if [[ "${VAR_DEBUG_TRACE}" == "true" || "${VAR_DEBUG_TRAP}" == "true" ]]; then
printf "❌ Vars Dump saved at : %s %s" "${LOG_VAR}" "${NL}"
fi
if "${VAR_DEBUG_TRAP}"; then
@@ -73,8 +73,8 @@ print_file_err() {
# Globals:
# ARGUMENTS_COUNT
# ARG_STR_ORG_INPUT
# C_RED
# C_RES
# RED
# RES
# ERRCMMD
# ERRCODE
# ERRFUNC
@@ -96,32 +96,32 @@ print_file_err() {
# None
#######################################
print_scr_err() {
printf "%s❌ CISS.debian.installer Script failed. %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
printf "%s❌ GIT Commit : %s %s%s" "${C_RED}" "${VAR_GIT_HEAD}" "${C_RES}" "${NL}" >&2
printf "%s❌ Version : %s %s%s" "${C_RED}" "${VAR_VERSION}" "${C_RES}" "${NL}" >&2
printf "%s❌ Hostsystem : %s %s%s" "${C_RED}" "${VAR_SYSTEM}" "${C_RES}" "${NL}" >&2
printf "%s❌ Error : %s %s%s" "${C_RED}" "${ERRCODE}" "${C_RES}" "${NL}" >&2
printf "%s❌ Line : %s %s%s" "${C_RED}" "${ERRLINE}" "${C_RES}" "${NL}" >&2
printf "%s❌ Script : %s %s%s" "${C_RED}" "${ERRSCRT}" "${C_RES}" "${NL}" >&2
printf "%s❌ Function : %s %s%s" "${C_RED}" "${ERRFUNC}" "${C_RES}" "${NL}" >&2
printf "%s❌ Command : %s %s%s" "${C_RED}" "${ERRCMMD}" "${C_RES}" "${NL}" >&2
printf "%s❌ Script PID : %s %s%s" "${C_RED}" "${$}" "${C_RES}" "${NL}" >&2
printf "%s❌ Script Runtime : %s %s%s" "${C_RED}" "${SECONDS}" "${C_RES}" "${NL}" >&2
printf "%s❌ Arguments Counter : %s %s%s" "${C_RED}" "${ARGUMENTS_COUNT}" "${C_RES}" "${NL}" >&2
printf "%s❌ Arguments Original : %s %s%s" "${C_RED}" "${ARG_STR_ORG_INPUT}" "${C_RES}" "${NL}" >&2
printf "%s❌ Arguments Sanitized : %s %s%s" "${C_RED}" "${VAR_ARG_SANITIZED}" "${C_RES}" "${NL}" >&2
printf "%s❌ Error Log saved at : %s %s%s" "${C_RED}" "${LOG_ERROR}" "${C_RES}" "${NL}" >&2
printf "%s❌ cat %s %s%s" "${C_RED}" "${LOG_ERROR}" "${C_RES}" "${NL}" >&2
if [[ "${VAR_DEBUG_TRACE}" || "${VAR_DEBUG_TRAP}" ]]; then
printf "%s❌ Vars Dump saved at : %s %s%s" "${C_RED}" "${LOG_VAR}" "${C_RES}" "${NL}" >&2
printf "%s❌ CISS.debian.installer Script failed. %s%s" "${RED}" "${RES}" "${NL}" >&2
printf "%s❌ GIT Commit : %s %s%s" "${RED}" "${VAR_GIT_HEAD}" "${RES}" "${NL}" >&2
printf "%s❌ Version : %s %s%s" "${RED}" "${VAR_VERSION}" "${RES}" "${NL}" >&2
printf "%s❌ Hostsystem : %s %s%s" "${RED}" "${VAR_SYSTEM}" "${RES}" "${NL}" >&2
printf "%s❌ Error : %s %s%s" "${RED}" "${ERRCODE}" "${RES}" "${NL}" >&2
printf "%s❌ Line : %s %s%s" "${RED}" "${ERRLINE}" "${RES}" "${NL}" >&2
printf "%s❌ Script : %s %s%s" "${RED}" "${ERRSCRT}" "${RES}" "${NL}" >&2
printf "%s❌ Function : %s %s%s" "${RED}" "${ERRFUNC}" "${RES}" "${NL}" >&2
printf "%s❌ Command : %s %s%s" "${RED}" "${ERRCMMD}" "${RES}" "${NL}" >&2
printf "%s❌ Script PID : %s %s%s" "${RED}" "${$}" "${RES}" "${NL}" >&2
printf "%s❌ Script Runtime : %s %s%s" "${RED}" "${SECONDS}" "${RES}" "${NL}" >&2
printf "%s❌ Arguments Counter : %s %s%s" "${RED}" "${ARGUMENTS_COUNT}" "${RES}" "${NL}" >&2
printf "%s❌ Arguments Original : %s %s%s" "${RED}" "${ARG_STR_ORG_INPUT}" "${RES}" "${NL}" >&2
printf "%s❌ Arguments Sanitized : %s %s%s" "${RED}" "${VAR_ARG_SANITIZED}" "${RES}" "${NL}" >&2
printf "%s❌ Error Log saved at : %s %s%s" "${RED}" "${LOG_ERROR}" "${RES}" "${NL}" >&2
printf "%s❌ cat %s %s%s" "${RED}" "${LOG_ERROR}" "${RES}" "${NL}" >&2
if [[ "${VAR_DEBUG_TRACE}" == "true" || "${VAR_DEBUG_TRAP}" == "true" ]]; then
printf "%s❌ Vars Dump saved at : %s %s%s" "${RED}" "${LOG_VAR}" "${RES}" "${NL}" >&2
fi
if "${VAR_DEBUG_TRAP}"; then
printf "%s❌ Debug Log saved at : %s %s%s" "${C_RED}" "${LOG_DEBUG}" "${C_RES}" "${NL}" >&2
printf "%s❌ cat %s %s%s" "${C_RED}" "${LOG_DEBUG}" "${C_RES}" "${NL}" >&2
printf "%s❌ Debug Log saved at : %s %s%s" "${RED}" "${LOG_DEBUG}" "${RES}" "${NL}" >&2
printf "%s❌ cat %s %s%s" "${RED}" "${LOG_DEBUG}" "${RES}" "${NL}" >&2
fi
if "${VAR_DEBUG_TRACE}"; then
printf "%s❌ Debug Log saved at : %s %s%s" "${C_RED}" "${LOG_TRACE}" "${C_RES}" "${NL}" >&2
printf "%s❌ cat %s %s%s" "${C_RED}" "${LOG_TRACE}" "${C_RES}" "${NL}" >&2
printf "%s❌ Debug Log saved at : %s %s%s" "${RED}" "${LOG_TRACE}" "${RES}" "${NL}" >&2
printf "%s❌ cat %s %s%s" "${RED}" "${LOG_TRACE}" "${RES}" "${NL}" >&2
fi
printf "%s" "${NL}"
}
@@ -151,7 +151,7 @@ trap_err() {
declare -g ERRLINE="$3"
declare -g ERRFUNC="$4"
declare -g ERRCMMD="$5"
if [[ "${VAR_DEBUG_TRACE}" || "${VAR_DEBUG_TRAP}" ]]; then dump_vars_exiting; fi
if [[ "${VAR_DEBUG_TRACE}" == "true" || "${VAR_DEBUG_TRAP}" == "true" ]]; then dump_vars_exiting; fi
case "${VAR_IN_DIALOG_WR}" in
box ) dialog_box_cleaner ;;
gauge ) dialog_gauge_cleaner ;;

View File

@@ -28,7 +28,7 @@ trap_exit() {
fi
if (( var_trap_on_exit_code == 0 )); then
if [[ "${VAR_DEBUG_TRACE}" || "${VAR_DEBUG_TRAP}" ]]; then dump_vars_exiting; fi
if [[ "${VAR_DEBUG_TRACE}" == "true" || "${VAR_DEBUG_TRAP}" == "true" ]]; then dump_vars_exiting; fi
clean_up "${var_trap_on_exit_code}"
print_scr_exit "${var_trap_on_exit_code}"
exit "${var_trap_on_exit_code}"
@@ -58,7 +58,7 @@ print_scr_exit() {
printf "\e[92m✅ CISS.debian.installer Script successful. \e[0m\n"
printf "\e[92m✅ Exited with Status : %s \e[0m\n" "${var_print_scr_exit_code}"
printf "\n"
if [[ "${VAR_DEBUG_TRACE}" || "${VAR_DEBUG_TRAP}" ]]; then
if [[ "${VAR_DEBUG_TRACE}" == "true" || "${VAR_DEBUG_TRAP}" == "true" ]]; then
printf "\e[92m✅ Vars Dump saved at : %s \e[0m\n" "${LOG_VAR}"
printf "\e[92m✅ cat %s \e[0m\n" "${LOG_VAR}"
fi

View File

@@ -15,8 +15,8 @@ guard_sourcing
#######################################
# Wrapper for mismatched Arguments.
# Globals:
# C_RED
# C_RES
# RED
# RES
# ERR_ARG_MISMATCH
# NL
# VAR_AUTO_INSTALL
@@ -34,7 +34,7 @@ arg_mismatch() {
;;
esac
fi
printf "%s❌ Error: '%s'. %s%s" "${C_RED}" "${1}" "${C_RES}" "${NL}" >&2
printf "%s❌ Error: '%s'. %s%s" "${RED}" "${1}" "${RES}" "${NL}" >&2
read -pr $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
exit "${ERR_ARG_MISMATCH}"
}

View File

@@ -29,8 +29,8 @@ arg_check() {
#######################################
# Function to sanitize a single argument
# Globals:
# C_RED
# C_RES
# RED
# RES
# ERR_UNSAFE_CHARACTER
# LOG_ERROR
# NL
@@ -55,9 +55,9 @@ sanitize_arg() {
box ) dialog_box_cleaner ;;
gauge ) dialog_gauge_cleaner ;;
esac
printf "%s❌ Control character : '%s'. %s%s" "${C_RED}" "${disallowed_ctrl}" "${C_RES}" "${NL}" >&2
printf "%s❌ in argument : '%s'. %s%s" "${C_RED}" "${input}" "${C_RES}" "${NL}" >&2
printf "%s❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
printf "%s❌ Control character : '%s'. %s%s" "${RED}" "${disallowed_ctrl}" "${RES}" "${NL}" >&2
printf "%s❌ in argument : '%s'. %s%s" "${RED}" "${input}" "${RES}" "${NL}" >&2
printf "%s❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' %s%s" "${RED}" "${RES}" "${NL}" >&2
# shellcheck disable=SC2162
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
exit "${ERR_UNSAFE_CHARACTER}"
@@ -79,9 +79,9 @@ sanitize_arg() {
box ) dialog_box_cleaner ;;
gauge ) dialog_gauge_cleaner ;;
esac
printf "%s❌ Invalid character : '%s'. %s%s" "${C_RED}" "${disallowed//?/& }" "${C_RES}" "${NL}" >&2
printf "%s❌ in argument : '%s'. %s%s" "${C_RED}" "${input}" "${C_RES}" "${NL}" >&2
printf "%s❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' %s%s" "${C_RED}" "${C_RES}" "${NL}" >&2
printf "%s❌ Invalid character : '%s'. %s%s" "${RED}" "${disallowed//?/& }" "${RES}" "${NL}" >&2
printf "%s❌ in argument : '%s'. %s%s" "${RED}" "${input}" "${RES}" "${NL}" >&2
printf "%s❌ Allowed Characters : 'a-z A-Z 0-9 . _ / = [ ] : \" - + space' %s%s" "${RED}" "${RES}" "${NL}" >&2
# shellcheck disable=SC2162
read -p $'\e[92m✅ Press \'ENTER\' to exit the script ... \e[0m'
exit "${ERR_UNSAFE_CHARACTER}"

View File

@@ -15,8 +15,8 @@ guard_sourcing
#######################################
# Check and setup Script Priorities
# Globals:
# C_GRE
# C_RES
# GRE
# RES
# NL
# VAR_PRIORITY
# VAR_REIONICE_CLASS
@@ -30,14 +30,14 @@ arg_priority_check() {
if [[ -n ${VAR_PRIORITY} ]]; then
renice "${VAR_PRIORITY}" -p "$$"
var=$(ps -o ni= -p $$) > /dev/null 2>&1
printf "%s✅ New renice value: '%s'. %s%s" "${C_GRE}" "${var}" "${C_RES}" "${NL}"
printf "%s✅ New renice value: '%s'. %s%s" "${GRE}" "${var}" "${RES}" "${NL}"
fi
# Check if ionice PRIORITY is set and adjust ionice priority.
if [[ -n ${VAR_REIONICE_CLASS} ]]; then
ionice -c"${VAR_REIONICE_CLASS:-2}" -n"${VAR_REIONICE_PRIORITY:-4}" -p "$$"
var=$(ionice -p $$) > /dev/null 2>&1
printf "%s✅ New ionice value: '%s'. %s%s" "${C_GRE}" "${var}" "${C_RES}" "${NL}"
printf "%s✅ New ionice value: '%s'. %s%s" "${GRE}" "${var}" "${RES}" "${NL}"
fi
}
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh