Update jlmkr.sh

This commit is contained in:
Jip-Hop 2023-01-29 15:52:12 +01:00
parent 2238e98aa7
commit 2a81daa157
1 changed files with 5 additions and 3 deletions

View File

@ -163,18 +163,20 @@ start_jail() {
# Build the array of arguments # Build the array of arguments
local arg local arg
# Read each argument from a string with null character as delimiter
# Append each argument, one at a time, to the array # Append each argument, one at a time, to the array
while read -r arg; do args+=("${arg}"); done < <(printf '%s' "${systemd_run_default_args}" | xargs -n 1) while IFS= read -rd '' arg; do args+=("${arg}"); done < <(xargs printf '%s\0' <<<"${systemd_run_default_args}")
# Append each element in systemd_run_additional_args to the args array # Append each element in systemd_run_additional_args to the args array
args+=("${systemd_run_additional_args[@]}") args+=("${systemd_run_additional_args[@]}")
# Add two more args to the array # Add two more args to the array
args+=(-- systemd-nspawn) args+=(-- systemd-nspawn)
# Append each argument, one at a time, to the array # Append each argument, one at a time, to the array
while read -r arg; do args+=("${arg}"); done < <(printf '%s' "${systemd_nspawn_default_args}" | xargs -n 1) while IFS= read -rd '' arg; do args+=("${arg}"); done < <(xargs printf '%s\0' <<<"${systemd_nspawn_default_args}")
# Append each element in systemd_nspawn_additional_args to the args array # Append each element in systemd_nspawn_additional_args to the args array
args+=("${systemd_nspawn_additional_args[@]}") args+=("${systemd_nspawn_additional_args[@]}")
# Append each argument, one at a time, to the array # Append each argument, one at a time, to the array
while read -r arg; do args+=("${arg}"); done < <(printf '%s' "${systemd_nspawn_user_args}" | xargs -n 1) while IFS= read -rd '' arg; do args+=("${arg}"); done < <(xargs printf '%s\0' <<<"${systemd_nspawn_user_args}")
# Concat all arguments in the array into a single space separated string, # Concat all arguments in the array into a single space separated string,
# but use %q to output each argument in a format that can be reused as shell input # but use %q to output each argument in a format that can be reused as shell input