V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m45s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m45s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -15,10 +15,14 @@ guard_sourcing
|
||||
#######################################
|
||||
# Wrapper for executing commands in the desired chroot environment.
|
||||
# Globals:
|
||||
# ERR_CHRT_COMMAND
|
||||
# TERM
|
||||
# Arguments:
|
||||
# $1: Target of the chroot environment.
|
||||
# $@: Commands and options and parameters to be executed in chroot.
|
||||
# Returns:
|
||||
# "${ERR_CHRT_COMMAND}": Unsuccessfully executed commands.
|
||||
# 0: Successfully executed commands.
|
||||
#######################################
|
||||
do_in_target() {
|
||||
declare var_chroot_target="$1"; shift
|
||||
@@ -28,10 +32,10 @@ do_in_target() {
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin \
|
||||
TERM="${TERM}" \
|
||||
"${ary_chroot_command[@]}"; then
|
||||
do_log "info" "false" "Success: chroot ${var_chroot_target}: ${ary_chroot_command[*]}"
|
||||
do_log "info" "true" "Success: chroot ${var_chroot_target}: ${ary_chroot_command[*]}"
|
||||
return 0
|
||||
else
|
||||
do_log "emergency" "false" "Failed: chroot ${var_chroot_target}: ${ary_chroot_command[*]}"
|
||||
do_log "emergency" "true" "Failed: chroot ${var_chroot_target}: ${ary_chroot_command[*]}"
|
||||
return "${ERR_CHRT_COMMAND}"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user