ProxMenux/scripts/menus/storage_menu.sh

57 lines
2.0 KiB
Bash
Raw Normal View History

2025-01-29 20:25:40 +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)
2025-04-15 20:04:45 +02:00
# Version : 1.1
# Last Updated: 15/04/2025
2025-01-29 20:25:40 +01:00
# ==========================================================
2025-01-31 22:06:44 +01:00
# Configuration ============================================
2025-01-29 20:44:02 +01:00
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
2025-01-29 20:25:40 +01:00
BASE_DIR="/usr/local/share/proxmenux"
2025-02-02 09:49:37 +01:00
UTILS_FILE="$BASE_DIR/utils.sh"
2025-01-29 20:25:40 +01:00
VENV_PATH="/opt/googletrans-env"
2025-01-29 20:44:02 +01:00
2025-02-02 09:49:37 +01:00
if [[ -f "$UTILS_FILE" ]]; then
source "$UTILS_FILE"
2025-01-29 20:41:01 +01:00
fi
2025-02-02 09:49:37 +01:00
load_language
initialize_cache
2025-01-31 22:06:44 +01:00
# ==========================================================
2025-01-29 20:25:40 +01:00
2025-04-15 20:04:45 +02:00
while true; do
OPTION=$(whiptail --title "$(translate "Disk and Storage Manager Menu")" --menu "$(translate "Select an option:")" 20 70 10 \
"1" "$(translate "Add Disk Passthrough to a VM")" \
"2" "$(translate "Add Disk") Passthrough $(translate "to a CT")" \
"3" "$(translate "Import Disk Image to a VM")" \
"4" "$(translate "Return to Main Menu")" 3>&1 1>&2 2>&3)
case $OPTION in
1)
msg_info2 "$(translate "Running script: Add Disk Passthrough to a VM")..."
bash <(curl -s "$REPO_URL/scripts/storage/disk-passthrough.sh")
;;
2)
msg_info2 "$(translate "Running script: Add Disk Passthrough to a CT")..."
bash <(curl -s "$REPO_URL/scripts/storage/disk-passthrough_ct.sh")
;;
3)
msg_info2 "$(translate "Running script: Import Disk Image to a VM")..."
bash <(curl -s "$REPO_URL/scripts/storage/import-disk-image.sh")
;;
4)
exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh")
;;
*)
exec bash <(curl -s "$REPO_URL/scripts/menus/main_menu.sh")
;;
esac
done