From 07d1f0837d825ed2faa0e45da5c90b8e111abc2b Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Thu, 27 Aug 2026 10:05:08 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Incorporate=20the=20new=20update=20funct?= =?UTF-8?q?ions=20to=20prevent=20a=20empty=20grep=20on=20=E2=80=A6=20(#168?= =?UTF-8?q?09)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: Incorporate the new update functions to prevent a empty grep on the legacy link in /usr/bin/update * Remove outdated comments from update-apps.sh Removed comments regarding the new-style entrypoint and fallback logic for service extraction. --------- Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com> --- tools/pve/update-apps.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/pve/update-apps.sh b/tools/pve/update-apps.sh index 867eed2f4..464c64450 100644 --- a/tools/pve/update-apps.sh +++ b/tools/pve/update-apps.sh @@ -173,7 +173,11 @@ 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$||') + + 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" }