From 0cc4d9c81749d5fad2f0ad29bbe03bddeb2e50cb Mon Sep 17 00:00:00 2001 From: Auto Fix Date: Mon, 11 May 2026 20:23:18 +0400 Subject: [PATCH] fix(service): normalize version check (strip -linux suffix); fix xdg-open on headless servers --- service.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/service.sh b/service.sh index cc47f55..20b93c4 100755 --- a/service.sh +++ b/service.sh @@ -383,6 +383,9 @@ hosts_update() { read -rp "Press Enter to continue..." } +# ============================================ +# CHECK FOR UPDATES +# ============================================ # ============================================ # CHECK FOR UPDATES # ============================================ @@ -402,7 +405,8 @@ check_for_updates() { return fi - if [[ "$LOCAL_VERSION" == "$github_version" ]]; then + local local_ver_norm="${LOCAL_VERSION%-linux}" + if [[ "$local_ver_norm" == "$github_version" ]]; then echo "Latest version installed: $LOCAL_VERSION" if [[ "$mode" == "interactive" ]]; then read -rp "Press Enter to continue..." @@ -419,9 +423,9 @@ check_for_updates() { if [[ "$mode" == "interactive" ]]; then read -rp "Open download page? [Y/n]: " ans if [[ "${ans:-Y}" == [yY]* ]]; then - if [[ -n "${DISPLAY:-}" ]] && command -v xdg-open >/dev/null 2>&1; then + if command -v xdg-open >/dev/null 2>&1 && [[ -n "${DISPLAY:-}" ]]; then xdg-open "$github_release_url" - elif [[ -n "${DISPLAY:-}" ]] && command -v gnome-open >/dev/null 2>&1; then + elif command -v gnome-open >/dev/null 2>&1 && [[ -n "${DISPLAY:-}" ]]; then gnome-open "$github_release_url" else echo "Please open: $github_release_url"