2025-01-29 15:11:44 +01:00
#!/bin/bash
2025-01-29 20:09:22 +01:00
# ==========================================================
2025-09-10 18:47:55 +02:00
# ProxMenux - A menu-driven script for Proxmox VE management
2025-01-29 20:09:22 +01:00
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
2026-01-19 17:15:00 +01:00
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
2025-05-04 23:49:44 +02:00
# Version : 2.0
# Last Updated: 04/04/2025
2025-01-29 20:09:22 +01:00
# ==========================================================
2025-01-31 22:09:00 +01:00
# Configuration ============================================
2025-11-03 01:03:39 +00:00
LOCAL_SCRIPTS = "/usr/local/share/proxmenux/scripts"
2025-01-29 20:09:22 +01:00
BASE_DIR = "/usr/local/share/proxmenux"
2025-02-01 08:44:34 +01:00
UTILS_FILE = " $BASE_DIR /utils.sh"
2025-01-29 20:09:22 +01:00
VENV_PATH = "/opt/googletrans-env"
2025-08-14 17:58:59 +02:00
2025-08-18 09:37:06 +02:00
if ! command -v dialog & >/dev/null; then
apt update -qq >/dev/null 2>& 1
apt install -y dialog >/dev/null 2>& 1
fi
2025-08-14 17:58:59 +02:00
check_pve9_translation_compatibility() {
local pve_version
if command -v pveversion & >/dev/null; then
pve_version = $( pveversion 2>/dev/null | grep -oP 'pve-manager/\K[0-9]+' | head -1)
else
return 0
fi
if [[ -n " $pve_version " ]] && [[ " $pve_version " -ge 9 ]] && [[ -d " $VENV_PATH " ]] ; then
local has_googletrans = false
local has_cache = false
if [[ -f " $VENV_PATH /bin/pip" ]] ; then
if " $VENV_PATH /bin/pip" list 2>/dev/null | grep -q "googletrans" ; then
has_googletrans = true
fi
fi
if [[ -f " $BASE_DIR /cache.json" ]] ; then
has_cache = true
fi
if [[ " $has_googletrans " = true ]] || [[ " $has_cache " = true ]] ; then
dialog --clear \
--backtitle "ProxMenux - Compatibility Required" \
--title "Translation Environment Incompatible with PVE $pve_version " \
--msgbox "NOTICE: You are running Proxmox VE $pve_version with translation components installed.\n\nTranslations are NOT supported in PVE 9+. This causes:\n• Menu loading errors\n• Translation failures\n• System instability\n\nREQUIRED ACTION:\nProxMenux will now automatically reinstall the Normal Version.\n\nThis process will:\n• Remove incompatible translation components\n• Install PVE 9+ compatible version\n• Preserve all your settings and preferences\n\nPress OK to continue with automatic reinstallation..." 20 75
2025-11-03 01:03:39 +00:00
bash " $BASE_DIR /install_proxmenux.sh"
2025-08-14 17:58:59 +02:00
fi
2025-11-03 01:03:39 +00:00
exit 0
2025-08-14 17:58:59 +02:00
fi
}
check_pve9_translation_compatibility
# ==========================================================
2025-02-01 08:44:34 +01:00
if [[ -f " $UTILS_FILE " ]] ; then
source " $UTILS_FILE "
2025-01-29 20:09:22 +01:00
fi
2025-05-09 09:52:25 +02:00
2025-08-14 17:58:59 +02:00
if [[ " $PROXMENUX_PVE9_WARNING_SHOWN " = "1" ]] ; then
if ! load_language 2>/dev/null; then
LANGUAGE = "en"
fi
else
load_language
initialize_cache
fi
# ==========================================================
2025-01-29 22:17:21 +01:00
show_menu() {
2025-05-04 23:49:44 +02:00
local TEMP_FILE
TEMP_FILE = $( mktemp)
2025-02-25 19:01:50 +01:00
2025-05-04 23:49:44 +02:00
while true; do
2025-08-14 17:58:59 +02:00
local menu_title = "Main ProxMenux"
2025-05-04 23:49:44 +02:00
dialog --clear \
--backtitle "ProxMenux" \
2025-08-14 17:58:59 +02:00
--title " $( translate " $menu_title " ) " \
2026-04-12 20:32:34 +02:00
--menu "\n $( translate "Select an option:" ) " 20 70 11 \
2025-05-04 23:49:44 +02:00
1 " $( translate "Settings post-install Proxmox" ) " \
2025-09-10 19:14:42 +02:00
2 " $( translate "Hardware: GPUs and Coral-TPU" ) " \
3 " $( translate "Create VM from template or script" ) " \
2026-04-12 20:32:34 +02:00
4 " $( translate "Disk Manager" ) " \
5 " $( translate "Storage & Share Manager" ) " \
2025-06-10 13:28:06 +02:00
6 " $( translate "Proxmox VE Helper Scripts" ) " \
2025-07-08 23:21:11 +02:00
7 " $( translate "Network Management" ) " \
2026-03-28 18:29:58 +01:00
8 " $( translate "Security" ) " \
9 " $( translate "Utilities and Tools" ) " \
2025-09-10 19:14:42 +02:00
h " $( translate "Help and Info Commands" ) " \
s " $( translate "Settings" ) " \
2025-07-04 20:36:19 +02:00
0 " $( translate "Exit" ) " 2>" $TEMP_FILE "
2025-01-29 20:09:22 +01:00
2025-05-04 23:49:44 +02:00
local EXIT_STATUS = $?
2025-01-29 15:11:44 +01:00
2025-05-04 23:49:44 +02:00
if [[ $EXIT_STATUS -ne 0 ]] ; then
clear
2025-08-02 12:02:10 +02:00
msg_ok " $( translate "Thank you for using ProxMenux. Goodbye!" ) "
2025-05-04 23:49:44 +02:00
rm -f " $TEMP_FILE "
exit 0
fi
2025-01-29 15:11:44 +01:00
2025-05-04 23:49:44 +02:00
OPTION = $( <" $TEMP_FILE " )
case $OPTION in
2025-11-03 01:03:39 +00:00
1) exec bash " $LOCAL_SCRIPTS /menus/menu_post_install.sh" ;;
2) exec bash " $LOCAL_SCRIPTS /menus/hw_grafics_menu.sh" ;;
3) exec bash " $LOCAL_SCRIPTS /menus/create_vm_menu.sh" ;;
4) exec bash " $LOCAL_SCRIPTS /menus/storage_menu.sh" ;;
5) exec bash " $LOCAL_SCRIPTS /menus/share_menu.sh" ;;
6) exec bash " $LOCAL_SCRIPTS /menus/menu_Helper_Scripts.sh" ;;
7) exec bash " $LOCAL_SCRIPTS /menus/network_menu.sh" ;;
2026-03-28 18:29:58 +01:00
8) exec bash " $LOCAL_SCRIPTS /menus/security_menu.sh" ;;
9) exec bash " $LOCAL_SCRIPTS /menus/utilities_menu.sh" ;;
2025-11-03 01:03:39 +00:00
h) bash " $LOCAL_SCRIPTS /help_info_menu.sh" ;;
s) exec bash " $LOCAL_SCRIPTS /menus/config_menu.sh" ;;
2025-09-10 18:47:55 +02:00
0) clear; msg_ok " $( translate "Thank you for using ProxMenux. Goodbye!" ) " ; rm -f " $TEMP_FILE " ; exit 0 ;;
2025-05-04 23:49:44 +02:00
*) msg_warn " $( translate "Invalid option" ) " ; sleep 2 ;;
esac
done
2025-01-29 22:17:21 +01:00
}
2025-08-18 09:37:06 +02:00
show_menu