mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-26 18:29:35 +02:00
fix(add-iptag): use qm set for VM tags to handle snapshot sections correctly (#14713)
This commit is contained in:
committed by
GitHub
parent
54e13bca94
commit
48b34d4c2e
@@ -811,13 +811,7 @@ update_tags() {
|
||||
if [[ "$type" == "lxc" ]]; then
|
||||
pct set "${vmid}" -tags "$(IFS=';'; echo "${next_tags[*]}")" &>/dev/null
|
||||
else
|
||||
local vm_config="/etc/pve/qemu-server/${vmid}.conf"
|
||||
if [[ -f "$vm_config" ]]; then
|
||||
sed -i '/^tags:/d' "$vm_config"
|
||||
if [[ ${#next_tags[@]} -gt 0 ]]; then
|
||||
echo "tags: $(IFS=';'; echo "${next_tags[*]}")" >> "$vm_config"
|
||||
fi
|
||||
fi
|
||||
qm set "${vmid}" --tags "$(IFS=';'; echo "${next_tags[*]}")" &>/dev/null
|
||||
fi
|
||||
else
|
||||
# Tags unchanged
|
||||
|
||||
Reference in New Issue
Block a user