From b4e5059c60cccf209323902054709dd8d128f576 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Thu, 27 Aug 2026 09:52:38 +0200 Subject: [PATCH] Fix: Incorporate the new update functions to prevent a empty grep on the legacy link in /usr/bin/update --- tools/pve/update-apps.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/pve/update-apps.sh b/tools/pve/update-apps.sh index 867eed2f4..1c9fd59ec 100644 --- a/tools/pve/update-apps.sh +++ b/tools/pve/update-apps.sh @@ -173,7 +173,15 @@ function detect_service() { rm -rf "$tmpdir" return 1 fi - service=$(grep -oE '/ct/[a-zA-Z0-9._-]+\.sh' "$update_file" 2>/dev/null | head -n1 | sed 's|.*/ct/||; s|\.sh$||') + + # New-style entrypoint (write_update_entrypoint in core.func) carries the app + # name in an export; its only /ct/ reference is the literal, unexpanded + # "/ct/${UPDATE_SCRIPT_NAME}.sh" fallback, which the legacy grep below cannot + # match. Prefer the explicit export, then fall back to the old literal path. + service=$(sed -n -E 's/^[[:space:]]*export[[:space:]]+UPDATE_SCRIPT_NAME=["'"'"']?([a-zA-Z0-9._-]+).*/\1/p' "$update_file" | head -n1) + [[ -z "$service" ]] && service=$(sed -n -E 's/^[[:space:]]*export[[:space:]]+SCRIPT_SLUG=["'"'"']?([a-zA-Z0-9._-]+).*/\1/p' "$update_file" | head -n1) + [[ -z "$service" ]] && service=$(grep -oE '/ct/[a-zA-Z0-9._-]+\.sh' "$update_file" 2>/dev/null | head -n1 | sed 's|.*/ct/||; s|\.sh$||') + rm -rf "$tmpdir" }