From fe9e5fa019c0048198c8a605b2441cb1d980496e Mon Sep 17 00:00:00 2001 From: anten-ka Date: Mon, 6 Apr 2026 21:32:00 +0300 Subject: [PATCH] v2.2.1 hotfix: fix telemt download grep pattern (grep -iE), add QR cleanup, bump version to 2.2.1 --- lib/telemt.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/telemt.sh b/lib/telemt.sh index 8fcd23a..022d951 100644 --- a/lib/telemt.sh +++ b/lib/telemt.sh @@ -25,15 +25,21 @@ get_telemt_download_url() { resp=$(curl -s --max-time 10 "$TELEMT_RELEASE_API" 2>/dev/null) if [ -z "$resp" ]; then return 1; fi - local pattern + # URL format: telemt-x86_64-linux-gnu.tar.gz (arch BEFORE linux) + local arch_pattern case "$arch" in - amd64) pattern="linux.*(amd64|x86_64)" ;; - arm64) pattern="linux.*(arm64|aarch64)" ;; - armv7) pattern="linux.*(armv7|arm)" ;; - *) pattern="linux.*${arch}" ;; + amd64) arch_pattern="(amd64|x86_64)" ;; + arm64) arch_pattern="(arm64|aarch64)" ;; + armv7) arch_pattern="(armv7|arm)" ;; + *) arch_pattern="${arch}" ;; esac - echo "$resp" | jq -r ".assets[].browser_download_url" 2>/dev/null | grep -iE "$pattern" | head -1 + echo "$resp" | jq -r ".assets[].browser_download_url" 2>/dev/null \ + | grep -iE "$arch_pattern" \ + | grep -i "linux" \ + | grep -v "sha256" \ + | grep "gnu" \ + | head -1 } # ── Установленная версия ─────────────────────────────────────────────────────