V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -38,7 +38,7 @@ debug_trace_header() {
|
|||||||
#shellcheck disable=SC2312
|
#shellcheck disable=SC2312
|
||||||
{
|
{
|
||||||
printf "\e[97m+\e[0m\e[92m%s: CISS.debian.installer Debug XTRACE Log \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)"
|
printf "\e[97m+\e[0m\e[92m%s: CISS.debian.installer Debug XTRACE Log \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: GIT Commit : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_GIT_HEAD}"
|
printf "\e[97m+\e[0m\e[92m%s: GIT Commit : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_GIT_REL}"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: Version : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_VERSION}"
|
printf "\e[97m+\e[0m\e[92m%s: Version : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_VERSION}"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: Epoch : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${EPOCHREALTIME}"
|
printf "\e[97m+\e[0m\e[92m%s: Epoch : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${EPOCHREALTIME}"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: Bash MAJ Release : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${BASH_VERSINFO[0]}"
|
printf "\e[97m+\e[0m\e[92m%s: Bash MAJ Release : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${BASH_VERSINFO[0]}"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ debug_trap_header() {
|
|||||||
# shellcheck disable=SC2312
|
# shellcheck disable=SC2312
|
||||||
{
|
{
|
||||||
printf "\e[97m+\e[0m\e[92m%s: CISS.debian.installer Debug TRAP Log \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)"
|
printf "\e[97m+\e[0m\e[92m%s: CISS.debian.installer Debug TRAP Log \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: GIT Commit : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_GIT_HEAD}"
|
printf "\e[97m+\e[0m\e[92m%s: GIT Commit : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_GIT_REL}"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: Version : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_VERSION}"
|
printf "\e[97m+\e[0m\e[92m%s: Version : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${VAR_VERSION}"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: Epoch : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${EPOCHREALTIME}"
|
printf "\e[97m+\e[0m\e[92m%s: Epoch : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${EPOCHREALTIME}"
|
||||||
printf "\e[97m+\e[0m\e[92m%s: Bash MAJ Release : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${BASH_VERSINFO[0]}"
|
printf "\e[97m+\e[0m\e[92m%s: Bash MAJ Release : %s \e[0m\n" "$(date -u +%Y-%m-%dT%H:%M:%S.%4N%z)" "${BASH_VERSINFO[0]}"
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ guard_sourcing
|
|||||||
print_file_err() {
|
print_file_err() {
|
||||||
{
|
{
|
||||||
printf "❌ CISS.debian.installer Script failed. %b" "${NL}"
|
printf "❌ CISS.debian.installer Script failed. %b" "${NL}"
|
||||||
printf "❌ GIT Commit : %s %b" "${VAR_GIT_HEAD}" "${NL}"
|
printf "❌ GIT Commit : %s %b" "${VAR_GIT_REL}" "${NL}"
|
||||||
printf "❌ Version : %s %b" "${VAR_VERSION}" "${NL}"
|
printf "❌ Version : %s %b" "${VAR_VERSION}" "${NL}"
|
||||||
printf "❌ Epoch : %s %b" "${EPOCHREALTIME}" "${NL}"
|
printf "❌ Epoch : %s %b" "${EPOCHREALTIME}" "${NL}"
|
||||||
printf "❌ Bash MAJ Release : %s %b" "${BASH_VERSINFO[0]}" "${NL}"
|
printf "❌ Bash MAJ Release : %s %b" "${BASH_VERSINFO[0]}" "${NL}"
|
||||||
@@ -114,7 +114,7 @@ print_file_err() {
|
|||||||
#######################################
|
#######################################
|
||||||
print_scr_err() {
|
print_scr_err() {
|
||||||
printf "%b❌ CISS.debian.installer Script failed. %b%b" "${RED}" "${RES}" "${NL}" >&2
|
printf "%b❌ CISS.debian.installer Script failed. %b%b" "${RED}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ GIT Commit : %s %b%b" "${RED}" "${VAR_GIT_HEAD}" "${RES}" "${NL}" >&2
|
printf "%b❌ GIT Commit : %s %b%b" "${RED}" "${VAR_GIT_REL}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ Version : %s %b%b" "${RED}" "${VAR_VERSION}" "${RES}" "${NL}" >&2
|
printf "%b❌ Version : %s %b%b" "${RED}" "${VAR_VERSION}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ Epoch : %s %b%b" "${RED}" "${EPOCHREALTIME}" "${RES}" "${NL}" >&2
|
printf "%b❌ Epoch : %s %b%b" "${RED}" "${EPOCHREALTIME}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ Bash MAJ Release : %s %b%b" "${RED}" "${BASH_VERSINFO[0]}" "${RES}" "${NL}" >&2
|
printf "%b❌ Bash MAJ Release : %s %b%b" "${RED}" "${BASH_VERSINFO[0]}" "${RES}" "${NL}" >&2
|
||||||
@@ -167,20 +167,15 @@ print_scr_err() {
|
|||||||
#######################################
|
#######################################
|
||||||
print_stacktrace() {
|
print_stacktrace() {
|
||||||
declare -i i=0
|
declare -i i=0
|
||||||
printf "%b" "${NL}"
|
printf "%b❌ %b%b" "${RED}" "${RES}" "${NL}"
|
||||||
printf "%b❌ Raw Stacktrace : %b%b" "${RED}" "${RES}" "${NL}"
|
printf "%b❌ Raw Stacktrace : %b%b" "${RED}" "${RES}" "${NL}"
|
||||||
for ((i=0; i<${#FUNCNAME[@]}-1; i++)); do
|
for ((i=0; i<${#FUNCNAME[@]}-1; i++)); do
|
||||||
printf "%b❌ ↳ %s() at: [%s:%s] %b%b" "${RED}" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${BASH_LINENO[i-1]}" "${RES}" "${NL}"
|
if (( i == 0 )); then
|
||||||
|
printf "%b❌ ↳ %s() at: [%s:%s] %b%b" "${RED}" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${LINENO:-?}" "${RES}" "${NL}"
|
||||||
|
else
|
||||||
|
printf "%b❌ ↳ %s() at: [%s:%s] %b%b" "${RED}" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${BASH_LINENO[i-1]:-?}" "${RES}" "${NL}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
#declare -i i
|
|
||||||
### Default: 2 = skip trap_on_err() and print_stacktrace()
|
|
||||||
#declare skip=${1:-2}
|
|
||||||
#printf "%b" "${NL}"
|
|
||||||
#printf "%b❌ Stacktrace (most recent call first): %b%b" "${RED}" "${RES}" "${NL}" >&2
|
|
||||||
#for ((i=skip; i<${#FUNCNAME[@]}-1; i++)); do
|
|
||||||
# printf "%b❌ ↳ %s() at[ %s:%s] %b%b" "${RED}" "${FUNCNAME[i]}" "${BASH_SOURCE[i]}" "${BASH_LINENO[i-1]}" "${RES}" "${NL}"
|
|
||||||
#done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ trap_exit_non_zero() {
|
|||||||
esac
|
esac
|
||||||
clean_up "${var_code}"
|
clean_up "${var_code}"
|
||||||
printf "%b❌ CISS.debian.installer Script failed. Most probably cause of unbound variable. %b%b" "${RED}" "${RES}" "${NL}" >&2
|
printf "%b❌ CISS.debian.installer Script failed. Most probably cause of unbound variable. %b%b" "${RED}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ GIT Commit : %s %b%b" "${RED}" "${VAR_GIT_HEAD}" "${RES}" "${NL}" >&2
|
printf "%b❌ GIT Commit : %s %b%b" "${RED}" "${VAR_GIT_REL}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ Version : %s %b%b" "${RED}" "${VAR_VERSION}" "${RES}" "${NL}" >&2
|
printf "%b❌ Version : %s %b%b" "${RED}" "${VAR_VERSION}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ Epoch : %s %b%b" "${RED}" "${EPOCHREALTIME}" "${RES}" "${NL}" >&2
|
printf "%b❌ Epoch : %s %b%b" "${RED}" "${EPOCHREALTIME}" "${RES}" "${NL}" >&2
|
||||||
printf "%b❌ Bash MAJ Release : %s %b%b" "${RED}" "${BASH_VERSINFO[0]}" "${RES}" "${NL}" >&2
|
printf "%b❌ Bash MAJ Release : %s %b%b" "${RED}" "${BASH_VERSINFO[0]}" "${RES}" "${NL}" >&2
|
||||||
|
|||||||
@@ -12,6 +12,28 @@
|
|||||||
|
|
||||||
guard_sourcing
|
guard_sourcing
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Generates salt.
|
||||||
|
# Globals:
|
||||||
|
# ERR_GENERATE_SALT
|
||||||
|
# NL
|
||||||
|
# Arguments:
|
||||||
|
# None
|
||||||
|
# Returns:
|
||||||
|
# 0: on success
|
||||||
|
# ERR_GENERATE_SALT
|
||||||
|
#######################################
|
||||||
|
generate_salt() {
|
||||||
|
declare var_salt=""
|
||||||
|
while :; do
|
||||||
|
# shellcheck disable=SC2312
|
||||||
|
var_salt=$(tr -dc 'A-Za-z0-9' < /dev/random | head -c 16) || return "${ERR_GENERATE_SALT}"
|
||||||
|
[[ ${#var_salt} -eq 16 ]] && break
|
||||||
|
done
|
||||||
|
printf '%s%b' "${var_salt}" "${NL}"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Reads and validates a secure one-line password file.
|
# Reads and validates a secure one-line password file.
|
||||||
# Globals:
|
# Globals:
|
||||||
@@ -37,8 +37,9 @@ nuke_passphrase() {
|
|||||||
### Turn on tracing again
|
### Turn on tracing again
|
||||||
#[[ "${VAR_DEBUG_TRACE,,}" == "true" ]] && set -x
|
#[[ "${VAR_DEBUG_TRACE,,}" == "true" ]] && set -x
|
||||||
|
|
||||||
# shellcheck disable=SC2312
|
if ! var_salt="$(generate_salt)"; then
|
||||||
var_salt=$(tr -dc 'A-Za-z0-9' < /dev/random | head -c 16)
|
return "${ERR_GENERATE_SALT}"
|
||||||
|
fi
|
||||||
|
|
||||||
### No tracing for security reasons
|
### No tracing for security reasons
|
||||||
#[[ "${VAR_DEBUG_TRACE,,}" == "true" ]] && set +x
|
#[[ "${VAR_DEBUG_TRACE,,}" == "true" ]] && set +x
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ source_guard "./lib/0100_arg_mismatch.sh"
|
|||||||
source_guard "./lib/0101_arg_sanitizer.sh"
|
source_guard "./lib/0101_arg_sanitizer.sh"
|
||||||
source_guard "./lib/0102_arg_parser.sh"
|
source_guard "./lib/0102_arg_parser.sh"
|
||||||
source_guard "./lib/0103_arg_priority_check.sh"
|
source_guard "./lib/0103_arg_priority_check.sh"
|
||||||
source_guard "./lib/0104_arg_passphrase_reader.sh"
|
source_guard "./lib/0104_arg_passphrase_modules.sh"
|
||||||
source_guard "./lib/0105_arg_nuke_converter.sh"
|
source_guard "./lib/0105_arg_nuke_converter.sh"
|
||||||
#source_guard "./lib/0110_check_kernel.sh"
|
#source_guard "./lib/0110_check_kernel.sh"
|
||||||
#source_guard "./lib/0120_check_provider.sh"
|
#source_guard "./lib/0120_check_provider.sh"
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ declare -girx ERR_PATH_NOT_VALID=223 # Specific path is not existing.
|
|||||||
declare -girx ERR_READ_NUKE_FILE=222 # Error reading Luks Nuke password file.
|
declare -girx ERR_READ_NUKE_FILE=222 # Error reading Luks Nuke password file.
|
||||||
declare -girx ERR_READ_GRUB_FILE=221 # Error reading Grub password file.
|
declare -girx ERR_READ_GRUB_FILE=221 # Error reading Grub password file.
|
||||||
declare -girx ERR_READ_PASS_FILE=220 # Error reading password file.
|
declare -girx ERR_READ_PASS_FILE=220 # Error reading password file.
|
||||||
|
declare -girx ERR_GENERATE_SALT=219 # Error generating salt.
|
||||||
|
|
||||||
### Definition of error trap vars.
|
### Definition of error trap vars.
|
||||||
declare -gx ERRCODE="" # = $? = $1 = ERRCODE
|
declare -gx ERRCODE="" # = $? = $1 = ERRCODE
|
||||||
|
|||||||
Reference in New Issue
Block a user