Files
ProxMenux/scripts/menus/main_menu.sh
T
MacRimi f5d2074a9a label OCI manager Apps as a Technology Preview, as Proxmox VE does
- OCI manager Apps carries the Technology Preview label that Proxmox VE gives to application containers from OCI images, in the main menu, the engine windows, the menu search, the message at the end of each installation, the release notes and the documentation.
- The documentation explains that the label refers to the Proxmox VE support it runs on, not to the ProxMenux engine, and stays until Proxmox VE marks it as stable.
- Spanish for the new message; the other languages are left to the translation bot.
2026-10-15 22:28:57 +02:00

132 lines
4.8 KiB
Bash

#!/bin/bash
# ==========================================================
# ProxMenux - A menu-driven script for Proxmox VE management
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
# Version : 2.0
# Last Updated: 04/04/2025
# ==========================================================
# Configuration ============================================
LOCAL_SCRIPTS="/usr/local/share/proxmenux/scripts"
BASE_DIR="/usr/local/share/proxmenux"
UTILS_FILE="$BASE_DIR/utils.sh"
if ! command -v dialog &>/dev/null; then
apt update -qq >/dev/null 2>&1
apt install -y dialog >/dev/null 2>&1
fi
# ==========================================================
# The legacy "PVE9 + googletrans incompatible" gate that used to live
# here has been removed along with the googletrans runtime. Translations
# are now a static lookup against $BASE_DIR/lang/<lang>.json — there is
# no runtime venv to be incompatible with any PVE version.
if [[ -f "$UTILS_FILE" ]]; then
source "$UTILS_FILE"
fi
if [[ "$PROXMENUX_PVE9_WARNING_SHOWN" = "1" ]]; then
if ! load_language 2>/dev/null; then
LANGUAGE="en"
fi
else
load_language
initialize_cache
fi
# ==========================================================
show_menu() {
local TEMP_FILE
TEMP_FILE=$(mktemp)
while true; do
local menu_title
menu_title="$(translate "Main menu")"
# As tall as its options need, cut to the terminal.
local height=24 limit=$(( $(tput lines 2>/dev/null || echo 24) - 2 ))
(( height > limit )) && height=$limit
local rows=$(( height - 8 ))
(( rows < 3 )) && rows=3
dialog --clear \
--backtitle "ProxMenux" \
--title "$menu_title" \
--menu "$(translate "Select an option:")" "$height" 75 "$rows" \
search "$(translate "Search options and applications")" \
"" "" \
1 "$(translate "Settings post-install Proxmox")" \
2 "$(translate "Hardware: GPUs and Coral-TPU")" \
3 "$(translate "Create VM from template or script")" \
4 "$(translate "Disk Manager")" \
5 "$(translate "Storage & Share Manager")" \
6 "$(translate "Proxmox VE Helper Scripts")" \
o "$(translate "OCI manager Apps (Technology Preview)")" \
7 "$(translate "Network Management")" \
8 "$(translate "Security")" \
9 "$(translate "Utilities and Tools")" \
b "$(translate "Host Backup & Restore")" \
h "$(translate "Help and Info Commands")" \
s "$(translate "Settings")" \
0 "$(translate "Exit")" 2>"$TEMP_FILE"
local EXIT_STATUS=$?
if [[ $EXIT_STATUS -ne 0 ]]; then
clear
msg_ok "$(translate "Thank you for using ProxMenux. Goodbye!")"
rm -f "$TEMP_FILE"
exit 0
fi
OPTION=$(<"$TEMP_FILE")
case $OPTION in
search)
# A result that is a sub-menu comes back as its path: it is
# opened from here, as the options below are.
local handoff
local -a target=()
handoff=$(mktemp)
python3 "$LOCAL_SCRIPTS/menus/search_menu.py" --handoff "$handoff"
mapfile -t target < "$handoff"
rm -f "$handoff"
if [[ "${target[0]:-}" == "$LOCAL_SCRIPTS"/* && -f "${target[0]}" ]]; then
rm -f "$TEMP_FILE"
exec bash "${target[@]}"
fi
;;
"") ;;
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" ;;
o) exec bash "$LOCAL_SCRIPTS/oci/oci_manager_apps.sh" ;;
7) exec bash "$LOCAL_SCRIPTS/menus/network_menu.sh" ;;
8) exec bash "$LOCAL_SCRIPTS/menus/security_menu.sh" ;;
9) exec bash "$LOCAL_SCRIPTS/menus/utilities_menu.sh" ;;
b) bash "$LOCAL_SCRIPTS/backup_restore/backup_host.sh" ;;
h) bash "$LOCAL_SCRIPTS/help_info_menu.sh" ;;
s) exec bash "$LOCAL_SCRIPTS/menus/config_menu.sh" ;;
0) clear; msg_ok "$(translate "Thank you for using ProxMenux. Goodbye!")"; rm -f "$TEMP_FILE"; exit 0 ;;
*) msg_warn "$(translate "Invalid option")"; sleep 2 ;;
esac
done
}
show_menu