V8.00.000.2025.06.17
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Use do_in_target() for:
|
||||
# Use chroot_exec() for:
|
||||
# - simple commands (e.g., dpkg, ln, mkdir, apt, etc.).
|
||||
# Use do_in_target_script() for:
|
||||
# Use chroot_script() for:
|
||||
# - all shell scripts, redirects, pipes, conditions, loops, or subshells.
|
||||
#######################################
|
||||
|
||||
@@ -31,7 +31,7 @@ guard_sourcing
|
||||
# 0: on success
|
||||
# ERR_CHRT_COMMAND: on failure
|
||||
#######################################
|
||||
do_in_target() {
|
||||
chroot_exec() {
|
||||
declare var_chroot_target="$1"; shift
|
||||
declare -a ary_chroot_command=("$@")
|
||||
declare -r var_default_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
@@ -39,7 +39,7 @@ do_in_target() {
|
||||
|
||||
if (( ${#ary_chroot_command[@]} == 0 )); then
|
||||
|
||||
do_log "emergency" "file_only" "1080() Empty command passed to 'do_in_target()'."
|
||||
do_log "emergency" "file_only" "1080() Empty command passed to 'chroot_exec()'."
|
||||
return "${ERR_CHRT_COMMAND}"
|
||||
|
||||
fi
|
||||
@@ -89,7 +89,7 @@ do_in_target() {
|
||||
# 0: on success
|
||||
# ERR_CHRT_COMMAND: on failure
|
||||
#######################################
|
||||
do_in_target_script() {
|
||||
chroot_script() {
|
||||
declare var_chroot_target="$1"
|
||||
declare var_chroot_script="$2"
|
||||
declare var_log_level_on_error="${3:-emergency}"
|
||||
@@ -98,7 +98,7 @@ do_in_target_script() {
|
||||
|
||||
if [[ -z "${var_chroot_script}" ]]; then
|
||||
|
||||
do_log "emergency" "file_only" "1080() Empty command passed to 'do_in_target_script()'."
|
||||
do_log "emergency" "file_only" "1080() Empty command passed to 'chroot_script()'."
|
||||
return "${ERR_CHRT_COMMAND}"
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user