mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-08-26 06:11:15 +00:00
Update scrips and menu
This commit is contained in:
@@ -29,22 +29,24 @@ initialize_cache
|
||||
show_menu() {
|
||||
while true; do
|
||||
OPTION=$(whiptail --title "$(translate "Main Menu")" --menu "$(translate "Select an option:")" 20 70 8 \
|
||||
"1" "$(translate "Hardware: GPUs and Coral-TPU")" \
|
||||
"2" "$(translate "Hard Drives, Disk Images, and Storage")" \
|
||||
"3" "$(translate "Essential Proxmox VE Helper-Scripts")" \
|
||||
"4" "$(translate "Network")" \
|
||||
"5" "$(translate "Settings")" \
|
||||
"6" "$(translate "Exit")" 3>&1 1>&2 2>&3)
|
||||
"1" "$(translate "Settings post-install Proxmox")" \
|
||||
"2" "$(translate "Hardware: GPUs and Coral-TPU")" \
|
||||
"3" "$(translate "Hard Drives, Disk Images, and Storage")" \
|
||||
"4" "$(translate "Essential Proxmox VE Helper-Scripts")" \
|
||||
"5" "$(translate "Network")" \
|
||||
"6" "$(translate "Settings")" \
|
||||
"7" "$(translate "Exit")" 3>&1 1>&2 2>&3)
|
||||
|
||||
|
||||
|
||||
case $OPTION in
|
||||
1) exec bash <(curl -s "$REPO_URL/scripts/menus/hw_grafics_menu.sh") ;;
|
||||
2) exec bash <(curl -s "$REPO_URL/scripts/menus/storage_menu.sh") ;;
|
||||
3) exec bash <(curl -s "$REPO_URL/scripts/menus/menu_Helper_Scripts.sh") ;;
|
||||
4) exec bash <(curl -s "$REPO_URL/scripts/repair_network.sh") ;;
|
||||
5) exec bash <(curl -s "$REPO_URL/scripts/menus/config_menu.sh") ;;
|
||||
6) clear; msg_ok "$(translate "Thank you for using ProxMenu. Goodbye!")"; exit 0 ;;
|
||||
1) exec bash <(curl -s "$REPO_URL/scripts/customizable_post_install.sh") ;;
|
||||
2) exec bash <(curl -s "$REPO_URL/scripts/menus/hw_grafics_menu.sh") ;;
|
||||
3) exec bash <(curl -s "$REPO_URL/scripts/menus/storage_menu.sh") ;;
|
||||
4) exec bash <(curl -s "$REPO_URL/scripts/menus/menu_Helper_Scripts.sh") ;;
|
||||
5) exec bash <(curl -s "$REPO_URL/scripts/repair_network.sh") ;;
|
||||
6) exec bash <(curl -s "$REPO_URL/scripts/menus/config_menu.sh") ;;
|
||||
7) clear; msg_ok "$(translate "Thank you for using ProxMenu. Goodbye!")"; exit 0 ;;
|
||||
*) msg_warn "$(translate "Invalid option")"; sleep 2 ;;
|
||||
esac
|
||||
|
||||
|
79
scripts/menus/menu_post_install.sh
Normal file
79
scripts/menus/menu_post_install.sh
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/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
|
||||
# ==========================================================
|
||||
|
||||
# Define scripts array
|
||||
scripts=(
|
||||
"Customizable script post-installation|ProxMenux|bash <(curl -s $REPO_URL/scripts/customizable_post_install.sh)"
|
||||
"Proxmox VE Post Install|Helper-Scripts|bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/post-pve-install.sh)\""
|
||||
"xshok-proxmox Post install|fork xshok-proxmox|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"
|
||||
)
|
||||
|
||||
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")")" "")
|
||||
|
||||
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
|
||||
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]}"
|
||||
if whiptail --title "$(translate "Confirm Execution")" \
|
||||
--yesno "$(translate "Are you sure you want to execute:") $name?" 10 60; then
|
||||
msg_info2 "$(translate "Executing script:") $name"
|
||||
eval "$command"
|
||||
msg_ok "$(translate "Script completed.")"
|
||||
msg_success "$(translate "Press Enter to return to the menu...")"
|
||||
read -r
|
||||
else
|
||||
msg_info2 "$(translate "Script execution cancelled.")"
|
||||
sleep 2
|
||||
fi
|
||||
fi
|
||||
else
|
||||
exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh")
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
show_menu
|
Reference in New Issue
Block a user