V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 43s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 43s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -57,7 +57,7 @@ usage() {
|
||||
echo " What you're looking at."
|
||||
echo
|
||||
echo -e "\e[97m --autoinstall, -a \e[0m"
|
||||
echo -e "\e[93m All data on the disks specified in './.preseed/partitioning.yaml' will be destroyed! \e[0m"
|
||||
echo -e "\e[93m All data on the disks specified in './.preseed/partitioning.yaml' will be destroyed! \e[0m"
|
||||
echo " Headless mode. Skip the dialog wrapper, provider note screen and interactive kernel selector dialog."
|
||||
echo " No user interaction is required in autoinstall mode."
|
||||
echo
|
||||
@@ -92,6 +92,7 @@ usage() {
|
||||
echo " Reset the nice priority value of the script and all its children"
|
||||
echo " to the desired <PRIORITY>. MUST be an integer (between '-19' and 19)."
|
||||
echo " Negative (higher) values MUST be enclosed in double quotes '\"'."
|
||||
echo " Defaults to '0'."
|
||||
echo
|
||||
echo -e "\e[97m --reionice-priority <CLASS> <PRIORITY> \e[0m"
|
||||
echo " Reset the ionice priority value of the script and all its children"
|
||||
|
||||
@@ -151,6 +151,7 @@ trap_err() {
|
||||
declare -g ERRLINE="$3"
|
||||
declare -g ERRFUNC="$4"
|
||||
declare -g ERRCMMD="$5"
|
||||
ERRTRAP="true"
|
||||
if [[ "${VAR_DEBUG_TRACE}" == "true" || "${VAR_DEBUG_TRAP}" == "true" ]]; then dump_vars_exiting; fi
|
||||
case "${VAR_IN_DIALOG_WR}" in
|
||||
box ) dialog_box_cleaner ;;
|
||||
|
||||
@@ -25,6 +25,10 @@ guard_sourcing
|
||||
trap_exit() {
|
||||
trap - DEBUG ERR EXIT INT
|
||||
declare -r var_trap_on_exit_code="$1"
|
||||
declare -r var_trap_on_exit_scrt="$2"
|
||||
declare -r var_trap_on_exit_line="$3"
|
||||
declare -r var_trap_on_exit_func="$4"
|
||||
declare -r var_trap_on_exit_cmmd="$5"
|
||||
|
||||
if [[ -n "${__preexec_invoke:-}" ]]; then
|
||||
debug_trap_logger "${var_trap_on_exit_code}" "${VAR_LAST_CMD}"
|
||||
@@ -37,8 +41,19 @@ trap_exit() {
|
||||
print_scr_exit "${var_trap_on_exit_code}"
|
||||
exit "${var_trap_on_exit_code}"
|
||||
else
|
||||
if [[ "${ERRTRAP}" == "false" ]]; then
|
||||
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 ;;
|
||||
esac
|
||||
fi
|
||||
clean_up "${var_trap_on_exit_code}"
|
||||
print_scr_exit "${var_trap_on_exit_code}"
|
||||
print_scr_exit "${var_trap_on_exit_code}" \
|
||||
"${var_trap_on_exit_scrt}" \
|
||||
"${var_trap_on_exit_line}" \
|
||||
"${var_trap_on_exit_func}" \
|
||||
"${var_trap_on_exit_cmmd}"
|
||||
exit "${var_trap_on_exit_code}"
|
||||
fi
|
||||
}
|
||||
@@ -57,6 +72,10 @@ trap_exit() {
|
||||
#######################################
|
||||
print_scr_exit() {
|
||||
declare -r var_print_scr_exit_code="$1"
|
||||
declare -r var_print_scr_exit_scrt="$2"
|
||||
declare -r var_print_scr_exit_line="$3"
|
||||
declare -r var_print_scr_exit_func="$4"
|
||||
declare -r var_print_scr_exit_cmmd="$5"
|
||||
if (( var_print_scr_exit_code == 0 )); then
|
||||
if [[ "${VAR_SCRIPT_SUCCESS}" == "true" ]]; then
|
||||
printf "\n"
|
||||
@@ -80,6 +99,34 @@ print_scr_exit() {
|
||||
printf "\e[95m🔗 https://coresecret.eu/spenden/ \e[0m\n"
|
||||
printf "\n"
|
||||
fi
|
||||
else
|
||||
if [[ "${ERRTRAP}" == "false" ]]; then
|
||||
printf "%s❌ CISS.debian.installer Script failed. Most probably cause of unbound variable. %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}" "${var_print_scr_exit_code}" "${RES}" "${NL}" >&2
|
||||
printf "%s❌ Line : %s %s%s" "${RED}" "${var_print_scr_exit_line}" "${RES}" "${NL}" >&2
|
||||
printf "%s❌ Script : %s %s%s" "${RED}" "${var_print_scr_exit_scrt}" "${RES}" "${NL}" >&2
|
||||
printf "%s❌ Function : %s %s%s" "${RED}" "${var_print_scr_exit_func}" "${RES}" "${NL}" >&2
|
||||
printf "%s❌ Command : %s %s%s" "${RED}" "${var_print_scr_exit_cmmd}" "${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}" "${VAR_PARAM_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
|
||||
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" "${RED}" "${LOG_DBG}" "${RES}" "${NL}" >&2
|
||||
printf "%s❌ cat %s %s%s" "${RED}" "${LOG_DBG}" "${RES}" "${NL}" >&2
|
||||
fi
|
||||
if "${VAR_DEBUG_TRACE}"; then
|
||||
printf "%s❌ Debug Log saved at : %s %s%s" "${RED}" "${LOG_TRC}" "${RES}" "${NL}" >&2
|
||||
printf "%s❌ cat %s %s%s" "${RED}" "${LOG_TRC}" "${RES}" "${NL}" >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
@@ -68,7 +68,7 @@ arg_parser() {
|
||||
|
||||
--renice-priority)
|
||||
if [[ -n ${2} && ${2} =~ ^-?[0-9]+$ && ${2} -ge -19 && ${2} -le 19 ]]; then
|
||||
declare -gix VAR_PRIORITY="${2}"
|
||||
VAR_PRIORITY="${2}"
|
||||
shift 2
|
||||
else
|
||||
arg_mismatch "--renice-priority MUST be an integer between '-19' and '19'."
|
||||
@@ -80,12 +80,12 @@ arg_parser() {
|
||||
arg_mismatch "--reionice-priority no values provided."
|
||||
else
|
||||
if [[ "${2}" =~ ^[1-3]$ ]]; then
|
||||
declare -gix VAR_REIONICE_CLASS="${2}"
|
||||
VAR_REIONICE_CLASS="${2}"
|
||||
if [[ -z "${3}" ]]; then
|
||||
:
|
||||
else
|
||||
if [[ "${3}" =~ ^[0-7]$ ]]; then
|
||||
declare -gix VAR_REIONICE_PRIORITY="${3}"
|
||||
VAR_REIONICE_PRIORITY="${3}"
|
||||
else
|
||||
arg_mismatch "--reionice-priority PRIORITY MUST be an integer between '0' and '7'."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user