V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m58s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m58s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -63,6 +63,7 @@ func_debootstrap() {
|
||||
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/hooks"
|
||||
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/keys"
|
||||
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/log"
|
||||
install -d -m 0700 -o root -g root "${var_target}/root/.ciss/cdi/log/pre-env"
|
||||
|
||||
mv -T "${var_target}/debootstrap" "${var_target}/root/.ciss/cdi/debootstrap"
|
||||
|
||||
|
||||
@@ -12,6 +12,21 @@
|
||||
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Copy pre-debootstrap-environment logs into target system.
|
||||
# Globals:
|
||||
# DIR_LOG
|
||||
# TARGET
|
||||
# Arguments:
|
||||
# None
|
||||
#######################################
|
||||
copy_logs() {
|
||||
cp -af "${DIR_LOG}"/* "${TARGET}/root/.ciss/cdi/log/pre-env"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f copy_logs
|
||||
|
||||
#######################################
|
||||
# Trap function to be called on 'EXIT'.
|
||||
# Handles also Errors like unbound variables, as they are not caught by Trap on 'ERR'.
|
||||
@@ -43,11 +58,15 @@ trap_exit() {
|
||||
fi
|
||||
|
||||
if (( var_exit_code == 0 )); then
|
||||
copy_logs
|
||||
trap_exit_zero "${var_exit_code}"
|
||||
else
|
||||
trap_exit_non_zero "${var_exit_code}" "${var_exit_scrt}" "${var_exit_line}" "${var_exit_func}" "${var_exit_cmmd}"
|
||||
fi
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f trap_exit
|
||||
|
||||
#######################################
|
||||
# Trap on Exit Handler for '0' Exit-Code.
|
||||
@@ -104,6 +123,9 @@ trap_exit_zero() {
|
||||
fi
|
||||
exit "${var_trap_exit_zero_code}"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f trap_exit_zero
|
||||
|
||||
#######################################
|
||||
# Trap on Exit Handler for 'Non-0' Exit-Code.
|
||||
@@ -214,4 +236,7 @@ trap_exit_non_zero() {
|
||||
|
||||
exit "${var_code}"
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f trap_exit_non_zero
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user