ProxMenux/scripts/menus/network_menu.sh

52 lines
1.6 KiB
Bash
Raw Permalink Normal View History

2025-01-29 21:34:45 +01:00
#!/bin/bash
# ==========================================================
# ProxMenu - A menu-driven script for Proxmox VE management
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
# License : MIT (https://raw.githubusercontent.com/MacRimi/ProxMenux/main/LICENSE)
# Version : 1.0
# Last Updated: 28/01/2025
# ==========================================================
# Configuration ============================================
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
BASE_DIR="/usr/local/share/proxmenux"
2025-02-02 10:12:20 +01:00
UTILS_FILE="$BASE_DIR/utils.sh"
2025-01-29 21:34:45 +01:00
VENV_PATH="/opt/googletrans-env"
2025-02-02 10:12:20 +01:00
if [[ -f "$UTILS_FILE" ]]; then
source "$UTILS_FILE"
2025-01-29 21:34:45 +01:00
fi
2025-02-02 10:12:20 +01:00
load_language
initialize_cache
2025-01-29 21:34:45 +01:00
# ==========================================================
2025-02-02 10:12:20 +01:00
2025-01-29 21:34:45 +01:00
while true; do
OPTION=$(whiptail --title "$(translate "Network Menu")" --menu "$(translate "Select an option:")" 15 60 2 \
"1" "$(translate "Repair Network")" \
"2" "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3)
case $OPTION in
1)
2025-02-04 17:14:49 +01:00
msg_info2 "$(translate "Running network repair...")"
2025-01-29 21:34:45 +01:00
if bash <(curl -s "$REPO_URL/scripts/repair_network.sh"); then
msg_ok "$(translate "Network repair completed.")"
else
msg_error "$(translate "Error in network repair.")"
fi
;;
2)
return
;;
*)
2025-02-04 18:02:41 +01:00
msg_warn "$(translate "Invalid option.")"
2025-01-29 21:34:45 +01:00
sleep 2
;;
esac
done