feat: enhance backup notes with guest name and improve whitespace handling and content line matching in container parsing. (#11752)

This commit is contained in:
carlosmaroot
2026-02-10 19:30:54 +01:00
committed by GitHub
parent 69e0dc6968
commit 5f2d463408

View File

@@ -131,7 +131,7 @@ function detect_service() {
function backup_container() {
msg_info "Creating backup for container $1"
vzdump $1 --compress zstd --storage $STORAGE_CHOICE -notes-template "community-scripts backup updater" >/dev/null 2>&1
vzdump $1 --compress zstd --storage $STORAGE_CHOICE -notes-template "{{guestname}} - community-scripts backup updater" >/dev/null 2>&1
status=$?
if [ $status -eq 0 ]; then
@@ -151,11 +151,11 @@ function get_backup_storages() {
split($0, a, ":")
type = a[1]
name = a[2]
sub(/^ +/, "", name)
gsub(/^[ \t]+|[ \t]+$/, "", name)
has_content = 0
has_backup = 0
}
/^ +content/ {
/^[ \t]*content/ {
has_content = 1
if ($0 ~ /backup/) has_backup = 1
}