mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-07-31 12:56:24 +00:00
update 1.2.2.2 beta
This commit is contained in:
@@ -40,6 +40,14 @@ if [[ -f "$UTILS_FILE" ]]; then
|
||||
source "$UTILS_FILE"
|
||||
fi
|
||||
|
||||
# Pull in ensure_repositories + PROXMENUX_UTILS — customizable already
|
||||
# sources this helper; auto did not, so a function that calls
|
||||
# `ensure_repositories` (setup_proxmox_repositories below) needs the
|
||||
# import here too.
|
||||
if [[ -f "$LOCAL_SCRIPTS/global/utils-install-functions.sh" ]]; then
|
||||
source "$LOCAL_SCRIPTS/global/utils-install-functions.sh"
|
||||
fi
|
||||
|
||||
load_language
|
||||
initialize_cache
|
||||
|
||||
@@ -191,6 +199,35 @@ remove_subscription_banner() {
|
||||
|
||||
|
||||
|
||||
setup_proxmox_repositories() {
|
||||
local FUNC_VERSION="1.1"
|
||||
# Description: Configure Proxmox + Debian APT repositories (no-subscription)
|
||||
# and set the correct file permissions.
|
||||
|
||||
msg_info2 "$(translate "Configuring Proxmox APT repositories...")"
|
||||
|
||||
if ! ensure_repositories; then
|
||||
msg_error "$(translate "Failed to configure Proxmox repositories")"
|
||||
register_tool "proxmox_repos" false "$FUNC_VERSION"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Defensive re-chmod: if the files already existed with the old 0640
|
||||
# permissions there is nothing for `ensure_repositories` to recreate,
|
||||
# so we still flip the bits explicitly here.
|
||||
local f
|
||||
for f in /etc/apt/sources.list.d/proxmox.sources \
|
||||
/etc/apt/sources.list.d/debian.sources \
|
||||
/etc/apt/sources.list.d/pve-no-subscription.list \
|
||||
/etc/apt/sources.list.d/pve-enterprise.list; do
|
||||
[[ -f "$f" ]] && chmod 0644 "$f" 2>/dev/null
|
||||
done
|
||||
|
||||
register_tool "proxmox_repos" true "$FUNC_VERSION"
|
||||
msg_success "$(translate "Proxmox APT repositories configured")"
|
||||
}
|
||||
|
||||
|
||||
configure_time_sync() {
|
||||
local FUNC_VERSION="1.0"
|
||||
# description: Detect timezone from public IP and enable systemd time sync (NTP).
|
||||
|
||||
@@ -101,6 +101,32 @@ register_tool() {
|
||||
|
||||
|
||||
|
||||
setup_proxmox_repositories() {
|
||||
local FUNC_VERSION="1.1"
|
||||
# Description: Configure Proxmox + Debian APT repositories (no-subscription)
|
||||
# and set the correct file permissions.
|
||||
|
||||
msg_info2 "$(translate "Configuring Proxmox APT repositories...")"
|
||||
|
||||
if ! ensure_repositories; then
|
||||
msg_error "$(translate "Failed to configure Proxmox repositories")"
|
||||
register_tool "proxmox_repos" false "$FUNC_VERSION"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local f
|
||||
for f in /etc/apt/sources.list.d/proxmox.sources \
|
||||
/etc/apt/sources.list.d/debian.sources \
|
||||
/etc/apt/sources.list.d/pve-no-subscription.list \
|
||||
/etc/apt/sources.list.d/pve-enterprise.list; do
|
||||
[[ -f "$f" ]] && chmod 0644 "$f" 2>/dev/null
|
||||
done
|
||||
|
||||
register_tool "proxmox_repos" true "$FUNC_VERSION"
|
||||
msg_success "$(translate "Proxmox APT repositories configured")"
|
||||
}
|
||||
|
||||
|
||||
check_extremeshok_warning() {
|
||||
local marker_file="/etc/extremeshok"
|
||||
|
||||
@@ -2930,6 +2956,7 @@ custom_post_category_label() {
|
||||
|
||||
custom_post_description_label() {
|
||||
case "$1" in
|
||||
"Configure Proxmox APT repositories") translate "Configure Proxmox APT repositories" ;;
|
||||
"Update and upgrade system") translate "Update and upgrade system" ;;
|
||||
"Synchronize time automatically") translate "Synchronize time automatically" ;;
|
||||
"Skip downloading additional languages") translate "Skip downloading additional languages" ;;
|
||||
@@ -3049,6 +3076,7 @@ main_menu() {
|
||||
)
|
||||
|
||||
local options=(
|
||||
"Basic Settings|Configure Proxmox APT repositories|REPOS"
|
||||
"Basic Settings|Update and upgrade system|APTUPGRADE"
|
||||
"Basic Settings|Synchronize time automatically|TIMESYNC"
|
||||
"Basic Settings|Skip downloading additional languages|NOAPTLANG"
|
||||
@@ -3184,6 +3212,7 @@ done
|
||||
IFS='|' read -r _ description function_name <<< "$option"
|
||||
if [[ ${selected_functions[$function_name]} -eq 1 ]]; then
|
||||
case $function_name in
|
||||
REPOS) setup_proxmox_repositories ;;
|
||||
APTUPGRADE) apt_upgrade ;;
|
||||
TIMESYNC) configure_time_sync ;;
|
||||
NOAPTLANG) skip_apt_languages ;;
|
||||
|
||||
@@ -75,7 +75,16 @@ SOURCED_CUSTOM=0
|
||||
ensure_flow_loaded() {
|
||||
local source_type="$1"
|
||||
case "$source_type" in
|
||||
auto)
|
||||
# `detected` is the synthetic source the registry assigns to a
|
||||
# tool when a legacy detector finds it on the host but the
|
||||
# entry was never written to installed_tools.json (e.g.
|
||||
# proxmox_repos on a pre-1.2.2 install). Treat it as `auto`
|
||||
# for the source-loading step — the legacy-tool's wrapper
|
||||
# function lives in auto_post_install.sh, and once the update
|
||||
# runs successfully `register_tool` overwrites the synthetic
|
||||
# entry with source="auto" so subsequent runs don't hit this
|
||||
# branch again.
|
||||
auto|detected)
|
||||
if [[ $SOURCED_AUTO -eq 0 ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
source "$LOCAL_SCRIPTS/post_install/auto_post_install.sh"
|
||||
@@ -90,7 +99,7 @@ ensure_flow_loaded() {
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: invalid source '$source_type' (must be 'auto' or 'custom')"
|
||||
echo "ERROR: invalid source '$source_type' (must be 'auto', 'custom', or 'detected')"
|
||||
return 2
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user