2025-02-24 23:44:47 +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: 24/02/2025
# ==========================================================
# Configuration ============================================
REPO_URL = "https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
BASE_DIR = "/usr/local/share/proxmenux"
UTILS_FILE = " $BASE_DIR /utils.sh "
VENV_PATH = "/opt/googletrans-env"
if [ [ -f " $UTILS_FILE " ] ] ; then
source " $UTILS_FILE "
fi
load_language
initialize_cache
2025-05-22 19:15:01 +02:00
#show_proxmenux_logo
2025-02-24 23:44:47 +01:00
# ==========================================================
2025-05-07 18:51:17 +02:00
confirm_and_run( ) {
local name = " $1 "
local command = " $2 "
if whiptail --title " $( translate "Confirmation" ) " \
--yesno " $( translate "Do you want to run the post-installation script from" ) $name ? " \
10 70; then
eval " $command "
echo ""
msg_success " $( translate 'Press ENTER to continue...' ) "
read -r _
else
msg_warn " $( translate "Cancelled by user." ) "
sleep 1
fi
}
2025-02-24 23:44:47 +01:00
# Define scripts array
scripts = (
" Customizable script post-installation|ProxMenux|bash <(curl -s $REPO_URL /scripts/customizable_post_install.sh) "
2025-05-07 18:51:17 +02:00
"Proxmox VE Post Install|Helper-Scripts|bash -c \"\$(wget -qLO - https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/post-pve-install.sh); msg_success \\\"\$(translate 'Press ENTER to continue...')\\\"; read -r _\""
"xshok-proxmox Post install|fork xshok-proxmox|confirm_and_run \"Xshok\" \"wget https://raw.githubusercontent.com/MacRimi/xshok-proxmox/master/install-post.sh -c -O install-post.sh && bash install-post.sh && rm install-post.sh\""
2025-05-02 19:33:51 +02:00
" Uninstall Tools|ProxMenux|bash <(curl -s $REPO_URL /scripts/uninstall-tools.sh) "
2025-02-24 23:44:47 +01:00
)
show_menu( ) {
while true; do
HEADER = $( printf " %-52s %-20s" " $( translate "Name" ) " " $( translate "Repository" ) " )
menu_items = ( )
for i in " ${ !scripts[@] } " ; do
IFS = '|' read -r name repository command <<< " ${ scripts [ $i ] } "
number = $(( i+1))
padded_option = $( printf "%2d %-50s" " $number " " $( translate " $name " ) " )
menu_items += ( " $padded_option " " $repository " )
done
menu_items += ( " $( printf "%2d %-40s" " $(( ${# scripts [@] } + 1 )) " " $( translate "Return to Main Menu" ) " ) " "" )
2025-02-25 18:17:24 +01:00
cleanup
2025-02-24 23:44:47 +01:00
script_selection = $( whiptail --title " $( translate "Post-Installation Scripts Menu" ) " \
--menu " \n $HEADER " 20 78 $(( ${# scripts [@] } + 1 )) \
" ${ menu_items [@] } " 3>& 1 1>& 2 2>& 3)
if [ -n " $script_selection " ] ; then
selected_number = $( echo " $script_selection " | awk '{print $1}' )
if [ " $selected_number " = " $(( ${# scripts [@] } + 1 )) " ] ; then
2025-05-22 19:19:34 +02:00
#show_proxmenux_logo
2025-02-24 23:44:47 +01:00
exec bash <( curl -s " $REPO_URL /scripts/menus/main_menu.sh " )
fi
index = $(( selected_number - 1 ))
if [ $index -ge 0 ] && [ $index -lt ${# scripts [@] } ] ; then
IFS = '|' read -r name repository command <<< " ${ scripts [ $index ] } "
2025-02-25 17:44:17 +01:00
eval " $command "
2025-02-24 23:44:47 +01:00
fi
2025-02-25 17:44:17 +01:00
2025-02-24 23:44:47 +01:00
else
2025-05-22 19:19:34 +02:00
#show_proxmenux_logo
2025-02-24 23:44:47 +01:00
exec bash <( curl -s " $REPO_URL /scripts/menus/main_menu.sh " )
fi
done
}
2025-05-24 16:48:58 +02:00
clear
2025-02-25 18:17:24 +01:00
if [ [ " $LANGUAGE " != "en" ] ] ; then
2025-05-24 16:48:58 +02:00
show_proxmenux_logo
2025-02-25 18:17:24 +01:00
msg_lang " $( translate "Generating automatic translations..." ) "
fi
2025-02-24 23:44:47 +01:00
show_menu