From 567bcecc809cfe23888136ae688e720abadefa1b Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Sun, 20 Jul 2025 11:42:25 +0200 Subject: [PATCH] Update network_menu.sh --- scripts/menus/network_menu.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/menus/network_menu.sh b/scripts/menus/network_menu.sh index 12f586c..cfc36a5 100644 --- a/scripts/menus/network_menu.sh +++ b/scripts/menus/network_menu.sh @@ -42,7 +42,17 @@ backup_network_config() { cp /etc/network/interfaces "$backup_file" echo "$backup_file" } +# Tool registration system +ensure_tools_json() { + [ -f "$TOOLS_JSON" ] || echo "{}" > "$TOOLS_JSON" +} +register_tool() { + local tool="$1" + local state="$2" + ensure_tools_json + jq --arg t "$tool" --argjson v "$state" '.[$t]=$v' "$TOOLS_JSON" > "$TOOLS_JSON.tmp" && mv "$TOOLS_JSON.tmp" "$TOOLS_JSON" +} # ========================================================== # Network Detection Functions detect_network_method() { @@ -737,9 +747,10 @@ setup_persistent_network() { local BACKUP_DIR="/etc/systemd/network/backup-$(date +%Y%m%d-%H%M%S)" if ! dialog --title "$(translate "Network Interface Setup")" \ - --yesno "$(translate "Create persistent network interface names?")" 8 60; then + --yesno "\n$(translate "Create persistent network interface names?")" 8 60; then return 1 fi + ensure_tools_json show_proxmenux_logo msg_info "$(translate "Setting up persistent network interfaces")" sleep 2