mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-14 08:52:22 +00:00
Update system_utils.sh
This commit is contained in:
parent
d1c8aeb25d
commit
c4f6dabd4d
@ -61,13 +61,25 @@ install_system_utils() {
|
|||||||
local need_update=false
|
local need_update=false
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ! -f "$sources_file" ]]; then
|
||||||
|
msg_warn "$(translate "sources.list not found, creating default Debian repository...")"
|
||||||
|
cat > "$sources_file" << EOF
|
||||||
|
# Default Debian ${OS_CODENAME} repository
|
||||||
|
deb http://deb.debian.org/debian ${OS_CODENAME} main contrib non-free non-free-firmware
|
||||||
|
EOF
|
||||||
|
need_update=true
|
||||||
|
else
|
||||||
|
|
||||||
if ! grep -q "deb.*${OS_CODENAME}.*main" "$sources_file"; then
|
if ! grep -q "deb.*${OS_CODENAME}.*main" "$sources_file"; then
|
||||||
echo "deb http://deb.debian.org/debian ${OS_CODENAME} main contrib non-free non-free-firmware" >> "$sources_file"
|
echo "deb http://deb.debian.org/debian ${OS_CODENAME} main contrib non-free non-free-firmware" >> "$sources_file"
|
||||||
need_update=true
|
need_update=true
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$need_update" = true ] || ! apt list --installed >/dev/null 2>&1; then
|
|
||||||
apt update >/dev/null 2>&1
|
if [[ "$need_update" == true ]] || ! apt list --installed >/dev/null 2>&1; then
|
||||||
|
msg_info "$(translate "Updating APT package lists...")"
|
||||||
|
apt-get update -o Acquire::AllowInsecureRepositories=true >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
@ -167,7 +179,7 @@ install_system_utils() {
|
|||||||
show_proxmenux_logo
|
show_proxmenux_logo
|
||||||
msg_title "$(translate "Installing group"): $group_name"
|
msg_title "$(translate "Installing group"): $group_name"
|
||||||
|
|
||||||
# Ensure repositories are configured before installing
|
|
||||||
if ! ensure_repositories; then
|
if ! ensure_repositories; then
|
||||||
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
|
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
|
||||||
return 1
|
return 1
|
||||||
@ -225,7 +237,7 @@ install_system_utils() {
|
|||||||
show_proxmenux_logo
|
show_proxmenux_logo
|
||||||
msg_title "$(translate "Installing selected utilities")"
|
msg_title "$(translate "Installing selected utilities")"
|
||||||
|
|
||||||
# Ensure repositories are configured before installing
|
|
||||||
if ! ensure_repositories; then
|
if ! ensure_repositories; then
|
||||||
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
|
msg_error "$(translate "Failed to configure repositories. Installation aborted.")"
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user