From 3e2924d2ed56f43f640c63fe9a3f9aab0ce860aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20B=C3=A9dard-Couture?= Date: Mon, 21 Jul 2025 15:30:07 -0400 Subject: [PATCH] Fix backup storage detection to support local dir --- tools/pve/update-apps.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/pve/update-apps.sh b/tools/pve/update-apps.sh index 1c392430..adcbe20c 100644 --- a/tools/pve/update-apps.sh +++ b/tools/pve/update-apps.sh @@ -38,6 +38,31 @@ function backup_container(){ fi } +function get_backup_storages(){ +STORAGES=$(awk ' +/^[a-z]+:/ { + if (name != "") { + if (has_backup || (!has_content && type == "dir")) print name + } + split($0, a, ":") + type = a[1] + name = a[2] + sub(/^ +/, "", name) + has_content = 0 + has_backup = 0 +} +/^ +content/ { + has_content = 1 + if ($0 ~ /backup/) has_backup = 1 +} +END { + if (name != "") { + if (has_backup || (!has_content && type == "dir")) print name + } +} +' /etc/pve/storage.cfg) +} + header_info echo "Loading..." whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC Container Update" --yesno "This will update LXC container. Proceed?" 10 58 || exit @@ -88,7 +113,8 @@ if(whiptail --backtitle "Proxmox VE Helper Scripts" --title "LXC Container Updat fi if [ "$BACKUP_CHOICE" == "yes" ]; then - STORAGES=$(awk '/^(\S+):/ {storage=$2} /content.*backup/ {print storage}' /etc/pve/storage.cfg) + #STORAGES=$(awk '/^(\S+):/ {storage=$2} /content.*backup/ {print storage}' /etc/pve/storage.cfg) + get_backup_storages if [ -z "$STORAGES" ]; then whiptail --msgbox "No storage with 'backup' found!" 8 40