fix(service): normalize version check (strip -linux suffix); fix xdg-open on headless servers
This commit is contained in:
10
service.sh
10
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"
|
||||
|
||||
Reference in New Issue
Block a user