From c976dd41844b3d857d6479a0139b5ecae2671dee Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 22 May 2025 11:00:28 +0200 Subject: [PATCH] Update pve-privilege-converter.sh --- tools/pve/pve-privilege-converter.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/pve/pve-privilege-converter.sh b/tools/pve/pve-privilege-converter.sh index 5f02ad1..fdf3ea2 100644 --- a/tools/pve/pve-privilege-converter.sh +++ b/tools/pve/pve-privilege-converter.sh @@ -57,7 +57,7 @@ select_backup_storage() { } backup_container() { - msg_info "Backing up container $CONTAINER_ID" + msg_custom "Backing up container $CONTAINER_ID" vzdump_output=$(mktemp) vzdump "$CONTAINER_ID" --compress zstd --storage "$BACKUP_STORAGE" --mode snapshot | tee "$vzdump_output" BACKUP_PATH=$(awk '/tar.zst/ {print $NF}' "$vzdump_output" | tr -d "'") @@ -72,10 +72,10 @@ backup_container() { select_target_storage() { echo -e "\nSelect target storage for new container:\n" - target_storages=$(pvesm status --content images | awk '{if(NR>1)print $1}') + mapfile -t target_storages < <(pvesm status --content images | awk 'NR > 1 {print $1}') PS3="Enter number of target storage: " - select opt in $target_storages; do + select opt in "${target_storages[@]}"; do if [[ -n "$opt" ]]; then TARGET_STORAGE="$opt" break @@ -106,7 +106,7 @@ perform_conversion() { UNPRIVILEGED=false fi - msg_info "Restoring as $(if $UNPRIVILEGED; then echo privileged; else echo unprivileged; fi) container" + msg_custom "Restoring as $(if $UNPRIVILEGED; then echo privileged; else echo unprivileged; fi) container" restore_opts=("$NEW_CONTAINER_ID" "$BACKUP_PATH" --storage "$TARGET_STORAGE") if $UNPRIVILEGED; then restore_opts+=(--unprivileged false) @@ -140,7 +140,7 @@ manage_states() { pct start "$NEW_CONTAINER_ID" msg_ok "New container started" else - msg_info "Skipped container state change" + msg_custom "Skipped container state change" fi } @@ -149,7 +149,7 @@ cleanup_files() { if [[ ${cleanup:-Y} =~ ^[Yy] ]]; then rm -f "$BACKUP_PATH" && msg_ok "Removed backup archive" else - msg_info "Retained backup archive" + msg_custom "Retained backup archive" fi }