Files
ProxMenux/scripts/menus/share_menu.sh

106 lines
4.0 KiB
Bash
Raw Normal View History

2025-08-22 18:05:14 +02:00
#!/bin/bash
# ==========================================================
2026-05-09 18:59:59 +02:00
# ProxMenux - Storage & Share Manager Menu
2025-08-22 18:05:14 +02:00
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
2026-05-09 18:59:59 +02:00
# License : GPL-3.0
# https://github.com/MacRimi/ProxMenux/blob/main/LICENSE
2025-08-22 18:05:14 +02:00
# Version : 1.2
2026-05-09 18:59:59 +02:00
# ==========================================================
# Description:
# Dispatcher for the Storage & Share Manager menu. Two blocks:
# HOST (register external or local storage as Proxmox storage,
# plus the local shared directory helper) and LXC (bind mount
# manager, NFS / Samba client and server for privileged CTs).
2025-08-22 18:05:14 +02:00
# ==========================================================
# Configuration
LOCAL_SCRIPTS="/usr/local/share/proxmenux/scripts"
2025-08-22 18:05:14 +02:00
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
# ==========================================================
while true; do
2025-09-01 18:45:14 +02:00
OPTION=$(dialog --colors --backtitle "ProxMenux" \
2026-04-12 20:32:34 +02:00
--title "$(translate "Storage & Share Manager")" \
2026-05-09 18:59:59 +02:00
--menu "\n$(translate "Select an option:")" 28 78 17 \
2026-04-04 00:54:57 +02:00
"" "\Z4──────────────────────── HOST ─────────────────────────\Zn" \
2026-05-09 18:59:59 +02:00
"1" "$(translate "Add NFS share as Proxmox Storage")" \
"2" "$(translate "Add Samba share as Proxmox Storage")" \
"3" "$(translate "Add iSCSI Target as Proxmox Storage")" \
2026-04-12 20:32:34 +02:00
"4" "$(translate "Add Local Disk as Proxmox Storage")" \
2026-05-09 18:59:59 +02:00
"" "" \
"" "\Z4─────────────── Host-only resources ──────────────────\Zn" \
"5" "$(translate "Add Shared Directory on Host")" \
2026-04-12 20:32:34 +02:00
"" "" \
2026-04-04 00:54:57 +02:00
"" "\Z4──────────────────────── LXC ─────────────────────────\Zn" \
2026-04-12 20:32:34 +02:00
"6" "$(translate "Configure LXC Mount Points (Host ↔ Container)")" \
2025-09-03 12:25:35 +02:00
"" "" \
2026-05-09 18:59:59 +02:00
"7" "$(translate "Configure NFS Client in LXC (only privileged)")" \
2026-04-12 20:32:34 +02:00
"8" "$(translate "Configure Samba Client in LXC (only privileged)")" \
2026-05-09 18:59:59 +02:00
"9" "$(translate "Configure NFS Server in LXC (only privileged)")" \
"10" "$(translate "Configure Samba Server in LXC (only privileged)")" \
2025-09-01 14:43:46 +02:00
"" "" \
2025-09-06 16:44:58 +02:00
"h" "$(translate "Help & Info (commands)")" \
2025-09-01 14:43:46 +02:00
"0" "$(translate "Return to Main Menu")" \
2>&1 >/dev/tty
) || { exec bash "$LOCAL_SCRIPTS/menus/main_menu.sh"; }
2025-09-01 14:43:46 +02:00
case "$OPTION" in
lxctitle|hosttitle)
continue
;;
2025-08-22 18:05:14 +02:00
1)
bash "$LOCAL_SCRIPTS/share/nfs_host.sh"
2025-08-22 18:05:14 +02:00
;;
2)
bash "$LOCAL_SCRIPTS/share/samba_host.sh"
2025-08-22 18:05:14 +02:00
;;
2025-09-01 14:43:46 +02:00
3)
2026-05-09 18:59:59 +02:00
bash "$LOCAL_SCRIPTS/share/iscsi_host.sh"
2026-04-01 23:09:51 +02:00
;;
2026-04-12 20:32:34 +02:00
4)
2026-04-01 23:09:51 +02:00
bash "$LOCAL_SCRIPTS/share/disk_host.sh"
;;
2026-04-12 20:32:34 +02:00
5)
2026-05-09 18:59:59 +02:00
bash "$LOCAL_SCRIPTS/share/local-shared-manager.sh"
2026-04-01 23:09:51 +02:00
;;
2026-04-12 20:32:34 +02:00
6)
bash "$LOCAL_SCRIPTS/share/lxc-mount-manager_minimal.sh"
2025-08-22 18:05:14 +02:00
;;
2026-04-12 20:32:34 +02:00
7)
bash "$LOCAL_SCRIPTS/share/nfs_client.sh"
2026-05-09 18:59:59 +02:00
;;
8)
bash "$LOCAL_SCRIPTS/share/samba_client.sh"
2025-08-22 18:05:14 +02:00
;;
2026-04-12 20:32:34 +02:00
9)
bash "$LOCAL_SCRIPTS/share/nfs_lxc_server.sh"
2025-09-01 14:43:46 +02:00
;;
2026-04-12 20:32:34 +02:00
10)
bash "$LOCAL_SCRIPTS/share/samba_lxc_server.sh"
2025-09-06 16:44:58 +02:00
;;
h)
bash "$LOCAL_SCRIPTS/share/commands_share.sh"
2025-08-22 18:05:14 +02:00
;;
2025-09-01 14:43:46 +02:00
0)
exec bash "$LOCAL_SCRIPTS/menus/main_menu.sh"
2025-08-22 18:05:14 +02:00
;;
*)
exec bash "$LOCAL_SCRIPTS/menus/main_menu.sh"
2025-08-22 18:05:14 +02:00
;;
esac
done