Update menu

This commit is contained in:
MacRimi
2026-04-18 18:48:33 +02:00
parent f950882ffd
commit 2fb9e74a13

35
menu
View File

@@ -85,37 +85,14 @@ check_updates_stable() {
} }
# ── Beta-mode update check (main + develop) ─────────────── # ── Beta-mode update check (main + develop) ───────────────
# When the beta program is active, check BOTH channels: # When the beta program is active, check BOTH channels. The stable check
# 1. main → prompt if a newer stable is available # is delegated to check_updates_stable (same prompt, same installer). After
# 2. develop → prompt if a newer beta build is available # that we only need the beta-specific part: develop vs beta_version.txt.
# Stable check runs first. Declining it falls through to the beta check.
check_updates_beta() { check_updates_beta() {
# ── 1. Stable release on main ── # 1. Stable release on main — reuse the non-beta path.
if [[ -f "$LOCAL_VERSION_FILE" ]]; then check_updates_stable
local REMOTE_STABLE LOCAL_STABLE
REMOTE_STABLE="$(curl -fsSL "$REPO_MAIN/version.txt" 2>/dev/null | head -n 1)"
LOCAL_STABLE="$(head -n 1 "$LOCAL_VERSION_FILE" 2>/dev/null)"
if [[ -n "$REMOTE_STABLE" && -n "$LOCAL_STABLE" && "$LOCAL_STABLE" != "$REMOTE_STABLE" ]] && \ # 2. Beta build on develop.
[[ "$(printf '%s\n%s\n' "$LOCAL_STABLE" "$REMOTE_STABLE" | sort -V | tail -1)" = "$REMOTE_STABLE" ]]; then
if whiptail --title "$(translate 'Update Available')" \
--yesno "$(translate 'New version available') ($REMOTE_STABLE)\n\n$(translate 'Do you want to update now?')" \
10 60 --defaultno; then
msg_warn "$(translate 'Starting ProxMenux update...')"
local INSTALL_STABLE_SCRIPT="$BASE_DIR/install_proxmenux.sh"
if curl -fsSL "$REPO_MAIN/install_proxmenux.sh" -o "$INSTALL_STABLE_SCRIPT"; then
chmod +x "$INSTALL_STABLE_SCRIPT"
bash "$INSTALL_STABLE_SCRIPT" --update
return 0
fi
fi
fi
fi
# ── 2. Beta build on develop ──
[[ ! -f "$BETA_VERSION_FILE" ]] && return 0 [[ ! -f "$BETA_VERSION_FILE" ]] && return 0
local REMOTE_BETA LOCAL_BETA local REMOTE_BETA LOCAL_BETA