V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 39s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 39s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -37,7 +37,7 @@ do_in_target() {
|
||||
declare -a ary_chroot_command=("$@")
|
||||
|
||||
if (( ${#ary_chroot_command[@]} == 0 )); then
|
||||
do_log "emergency" "true" "Empty command passed to 'do_in_target()'."
|
||||
do_log "emergency" "file_only" "Empty command passed to 'do_in_target()'."
|
||||
return "${ERR_CHRT_COMMAND}"
|
||||
fi
|
||||
|
||||
@@ -49,10 +49,10 @@ do_in_target() {
|
||||
LC_ALL=C.UTF-8 \
|
||||
"${ary_chroot_command[@]}"
|
||||
then
|
||||
do_log "info" "true" "Success: chroot '${var_chroot_target}': '${ary_chroot_command[*]}'."
|
||||
do_log "info" "file_only" "Success: chroot '${var_chroot_target}': '${ary_chroot_command[*]}'."
|
||||
return 0
|
||||
else
|
||||
do_log "emergency" "true" "Failed: chroot '${var_chroot_target}': '${ary_chroot_command[*]}'."
|
||||
do_log "emergency" "file_only" "Failed: chroot '${var_chroot_target}': '${ary_chroot_command[*]}'."
|
||||
return "${ERR_CHRT_COMMAND}"
|
||||
fi
|
||||
}
|
||||
@@ -77,11 +77,11 @@ do_in_target_script() {
|
||||
declare var_chroot_script="$1"
|
||||
|
||||
if [[ -z "${var_chroot_script}" ]]; then
|
||||
do_log "emergency" "true" "Empty command passed to 'do_in_target_script()'."
|
||||
do_log "emergency" "file_only" "Empty command passed to 'do_in_target_script()'."
|
||||
return "${ERR_CHRT_COMMAND}"
|
||||
fi
|
||||
|
||||
do_log "debug" "true" "Evaluating chroot script in '${var_chroot_target}': '${var_chroot_script}'."
|
||||
# do_log "debug" "file_only" "Evaluating chroot script in '${var_chroot_target}': '${var_chroot_script}'."
|
||||
|
||||
if chroot "${var_chroot_target}" /usr/bin/env -i \
|
||||
HOME=/root \
|
||||
@@ -93,14 +93,14 @@ do_in_target_script() {
|
||||
|
||||
then
|
||||
|
||||
do_log "info" "true" "Success: chroot '${var_chroot_target}': '${var_chroot_script}'."
|
||||
do_log "info" "file_only" "Success: chroot '${var_chroot_target}': '${var_chroot_script}'."
|
||||
return 0
|
||||
|
||||
else
|
||||
|
||||
declare -i var_chroot_rc="${?}"
|
||||
do_log "emergency" "true" "Failure: chroot '${var_chroot_target}': '${var_chroot_script}'."
|
||||
do_log "debug" "true" "Return code: '${var_chroot_rc}'."
|
||||
do_log "emergency" "file_only" "Failure: chroot '${var_chroot_target}': '${var_chroot_script}'."
|
||||
do_log "debug" "file_only" "Return code: '${var_chroot_rc}'."
|
||||
|
||||
# TODO: Test with Dialog Wrapper in interactive mode.
|
||||
#if [[ "${DEBUG_INTERACTIVE}" == "true" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user