mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-07 14:06:40 +00:00
fix(installer): surface apt errors and prevent false success messages
This commit is contained in:
+10
-7
@@ -680,12 +680,15 @@ install_normal_version() {
|
|||||||
show_progress $current_step $total_steps "Installing basic dependencies."
|
show_progress $current_step $total_steps "Installing basic dependencies."
|
||||||
|
|
||||||
msg_info "Refreshing apt cache..."
|
msg_info "Refreshing apt cache..."
|
||||||
apt-get update -y > /dev/null 2>&1 || true
|
if apt-get update -y; then
|
||||||
msg_ok "apt cache refreshed."
|
msg_ok "apt cache refreshed."
|
||||||
|
else
|
||||||
|
msg_warn "apt cache refresh failed; checking available packages."
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Installing jq..."
|
msg_info "Installing jq..."
|
||||||
if ! command -v jq > /dev/null 2>&1; then
|
if ! command -v jq > /dev/null 2>&1; then
|
||||||
if apt-get install -y jq > /dev/null 2>&1 && command -v jq > /dev/null 2>&1; then
|
if apt-get install -y jq && command -v jq > /dev/null 2>&1; then
|
||||||
update_config "jq" "installed"
|
update_config "jq" "installed"
|
||||||
else
|
else
|
||||||
local jq_url="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64"
|
local jq_url="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64"
|
||||||
@@ -715,7 +718,7 @@ install_normal_version() {
|
|||||||
# dpkg-query for the EXACT package — `dpkg -l | grep -qw python3`
|
# dpkg-query for the EXACT package — `dpkg -l | grep -qw python3`
|
||||||
# falsely matches `python3-pip`. Issue #205.
|
# falsely matches `python3-pip`. Issue #205.
|
||||||
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "ok installed"; then
|
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "ok installed"; then
|
||||||
if apt-get install -y "$pkg" > /dev/null 2>&1; then
|
if apt-get install -y "$pkg"; then
|
||||||
update_config "$pkg" "installed"
|
update_config "$pkg" "installed"
|
||||||
else
|
else
|
||||||
msg_error "Failed to install $pkg. Please install it manually."
|
msg_error "Failed to install $pkg. Please install it manually."
|
||||||
@@ -901,12 +904,12 @@ install_proxmenux() {
|
|||||||
# /usr/local/bin/menu — the new copy is the only thing parsed.
|
# /usr/local/bin/menu — the new copy is the only thing parsed.
|
||||||
show_proxmenux_logo
|
show_proxmenux_logo
|
||||||
msg_title "Updating ProxMenux"
|
msg_title "Updating ProxMenux"
|
||||||
install_normal_version
|
install_normal_version || return $?
|
||||||
else
|
else
|
||||||
show_installation_options
|
show_installation_options
|
||||||
show_proxmenux_logo
|
show_proxmenux_logo
|
||||||
msg_title "Installing ProxMenux"
|
msg_title "Installing ProxMenux"
|
||||||
install_normal_version
|
install_normal_version || return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$UTILS_FILE" ]]; then
|
if [[ -f "$UTILS_FILE" ]]; then
|
||||||
@@ -964,4 +967,4 @@ if [ "$(id -u)" -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cleanup_corrupted_files
|
cleanup_corrupted_files
|
||||||
install_proxmenux
|
install_proxmenux || exit $?
|
||||||
|
|||||||
@@ -611,12 +611,15 @@ install_beta() {
|
|||||||
show_progress $current_step $total_steps "Installing system dependencies"
|
show_progress $current_step $total_steps "Installing system dependencies"
|
||||||
|
|
||||||
msg_info "Refreshing apt cache..."
|
msg_info "Refreshing apt cache..."
|
||||||
apt-get update -y > /dev/null 2>&1 || true
|
if apt-get update -y; then
|
||||||
msg_ok "apt cache refreshed."
|
msg_ok "apt cache refreshed."
|
||||||
|
else
|
||||||
|
msg_warn "apt cache refresh failed; checking available packages."
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Installing jq..."
|
msg_info "Installing jq..."
|
||||||
if ! command -v jq > /dev/null 2>&1; then
|
if ! command -v jq > /dev/null 2>&1; then
|
||||||
if apt-get install -y jq > /dev/null 2>&1 && command -v jq > /dev/null 2>&1; then
|
if apt-get install -y jq && command -v jq > /dev/null 2>&1; then
|
||||||
update_config "jq" "installed"
|
update_config "jq" "installed"
|
||||||
else
|
else
|
||||||
local jq_url="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64"
|
local jq_url="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64"
|
||||||
@@ -640,7 +643,7 @@ install_beta() {
|
|||||||
# dpkg-query for the EXACT package name — `dpkg -l | grep -qw python3`
|
# dpkg-query for the EXACT package name — `dpkg -l | grep -qw python3`
|
||||||
# falsely matches `python3-pip`. Issue #205.
|
# falsely matches `python3-pip`. Issue #205.
|
||||||
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "ok installed"; then
|
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "ok installed"; then
|
||||||
if apt-get install -y "$pkg" > /dev/null 2>&1; then
|
if apt-get install -y "$pkg"; then
|
||||||
update_config "$pkg" "installed"
|
update_config "$pkg" "installed"
|
||||||
else
|
else
|
||||||
msg_error "Failed to install $pkg. Please install it manually."
|
msg_error "Failed to install $pkg. Please install it manually."
|
||||||
@@ -814,7 +817,10 @@ else
|
|||||||
show_beta_welcome
|
show_beta_welcome
|
||||||
msg_title "Installing ProxMenux Beta — branch: develop"
|
msg_title "Installing ProxMenux Beta — branch: develop"
|
||||||
fi
|
fi
|
||||||
install_beta
|
if ! install_beta; then
|
||||||
|
msg_error "Beta installation stopped before completion. Resolve the error above and rerun the installer."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Load utils if available
|
# Load utils if available
|
||||||
[ -f "$UTILS_FILE" ] && source "$UTILS_FILE"
|
[ -f "$UTILS_FILE" ] && source "$UTILS_FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user