2025-08-22 18:05:14 +02: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.5
|
|
|
|
# Last Updated: 04/08/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
|
|
|
|
# ==========================================================
|
|
|
|
|
|
|
|
show_command() {
|
|
|
|
local step="$1"
|
|
|
|
local description="$2"
|
|
|
|
local command="$3"
|
|
|
|
local note="$4"
|
|
|
|
local command_extra="$5"
|
|
|
|
|
|
|
|
echo -e "${BGN}${step}.${CL} ${BL}${description}${CL}"
|
|
|
|
echo ""
|
|
|
|
echo -e "${TAB}${command}"
|
|
|
|
echo -e
|
|
|
|
[[ -n "$note" ]] && echo -e "${TAB}${DARK_GRAY}${note}${CL}"
|
|
|
|
[[ -n "$command_extra" ]] && echo -e "${TAB}${YW}${command_extra}${CL}"
|
|
|
|
echo ""
|
|
|
|
}
|
|
|
|
|
|
|
|
show_how_to_enter_lxc() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
|
|
|
msg_title "$(translate "How to Access an LXC Terminal from Proxmox Host")"
|
|
|
|
|
|
|
|
msg_info2 "$(translate "Use these commands on your Proxmox host to access an LXC container's terminal:")"
|
|
|
|
echo -e
|
|
|
|
|
|
|
|
show_command "1" \
|
|
|
|
"$(translate "Get a list of all your containers:")" \
|
|
|
|
"pct list" \
|
|
|
|
"" \
|
|
|
|
""
|
|
|
|
|
|
|
|
show_command "2" \
|
|
|
|
"$(translate "Enter the container's terminal")" \
|
|
|
|
"pct enter ${CUS}<container-id>${CL}" \
|
|
|
|
"$(translate "Replace <container-id> with the actual ID.")"\
|
|
|
|
"$(translate "For example: pct enter 101")"
|
|
|
|
|
|
|
|
show_command "3" \
|
|
|
|
"$(translate "To exit the container's terminal, press:")" \
|
|
|
|
"CTRL + D" \
|
|
|
|
"" \
|
|
|
|
""
|
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
2025-09-06 23:35:46 +02:00
|
|
|
show_host_mount_resources_help() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_title "$(translate "Mount Remote Resources on Proxmox Host")"
|
2025-09-06 23:35:46 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_info2 "$(translate "How to mount NFS and Samba shares directly on the Proxmox host. Proxmox already has the necessary tools installed.")"
|
2025-09-06 23:35:46 +02:00
|
|
|
echo -e
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
echo -e "${BOLD}${BL}=== MOUNT NFS SHARE ===${CL}"
|
2025-09-06 23:35:46 +02:00
|
|
|
echo -e
|
|
|
|
|
2025-09-06 23:50:57 +02:00
|
|
|
show_command "1" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Create mount point:")" \
|
|
|
|
"mkdir -p ${CUS}/mnt/nfs_share${CL}" \
|
|
|
|
"$(translate "Replace with your preferred path.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-06 23:50:57 +02:00
|
|
|
show_command "2" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Mount NFS share:")" \
|
|
|
|
"mount -t nfs ${CUS}192.168.1.100${CL}:${CUS}/path/to/share${CL} ${CUS}/mnt/nfs_share${CL}" \
|
|
|
|
"$(translate "Replace IP and paths with your values.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-06 23:50:57 +02:00
|
|
|
show_command "3" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Make permanent (optional):")" \
|
|
|
|
"echo '${CUS}192.168.1.100${CL}:${CUS}/path/to/share${CL} ${CUS}/mnt/nfs_share${CL} nfs4 rw,hard,intr,_netdev,rsize=1048576,wsize=1048576,timeo=600,retrans=2 0 0' >> /etc/fstab" \
|
|
|
|
"$(translate "_netdev waits for network before mounting.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
echo -e "${BOLD}${BL}=== MOUNT SAMBA SHARE ===${CL}"
|
2025-09-06 23:35:46 +02:00
|
|
|
echo -e
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "4" \
|
|
|
|
"$(translate "Create mount point:")" \
|
|
|
|
"mkdir -p ${CUS}/mnt/samba_share${CL}" \
|
|
|
|
"$(translate "Replace with your preferred path.")" \
|
|
|
|
""
|
2025-09-06 23:35:46 +02:00
|
|
|
|
2025-09-06 23:59:23 +02:00
|
|
|
show_command "5" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Mount Samba share:")" \
|
|
|
|
"mount -t cifs //${CUS}192.168.1.100${CL}/${CUS}sharename${CL} ${CUS}/mnt/samba_share${CL} -o username=${CUS}user${CL}" \
|
|
|
|
"$(translate "You will be prompted for password. Replace IP, share and user.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-06 23:59:23 +02:00
|
|
|
show_command "6" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Make permanent (optional):")" \
|
|
|
|
"echo '//${CUS}192.168.1.100${CL}/${CUS}sharename${CL} ${CUS}/mnt/samba_share${CL} cifs username=${CUS}user${CL},password=${CUS}pass${CL},_netdev 0 0' >> /etc/fstab" \
|
|
|
|
"$(translate "Replace with your credentials.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
echo -e "${BOLD}${BL}=== CREATE LOCAL DIRECTORY ===${CL}"
|
|
|
|
echo -e
|
|
|
|
|
2025-09-06 23:59:23 +02:00
|
|
|
show_command "7" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Create directory:")" \
|
|
|
|
"mkdir -p ${CUS}/mnt/local_share${CL}" \
|
|
|
|
"$(translate "Creates a local directory on Proxmox host.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-06 23:59:23 +02:00
|
|
|
show_command "8" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Set permissions:")" \
|
|
|
|
"chmod 755 ${CUS}/mnt/local_share${CL}" \
|
|
|
|
"$(translate "Sets basic read/write permissions.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-06 23:59:23 +02:00
|
|
|
show_command "9" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Verify mounts:")" \
|
|
|
|
"df -h" \
|
|
|
|
"$(translate "Shows all mounted filesystems.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
|
|
|
show_host_to_lxc_mount_help() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_title "$(translate "Mount Host Directory to LXC Container")"
|
2025-09-06 23:35:46 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_info2 "$(translate "How to mount a Proxmox host directory into an LXC container. Execute these commands on the Proxmox host.")"
|
2025-09-06 23:35:46 +02:00
|
|
|
echo -e
|
|
|
|
|
|
|
|
show_command "1" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Add mount point to container:")" \
|
|
|
|
"pct set ${CUS}<container-id>${CL} -mp0 ${CUS}/host/directory${CL},mp=${CUS}/container/path${CL},backup=0,shared=1" \
|
|
|
|
"$(translate "Replace container-id, host directory and container path.")" \
|
|
|
|
"$(translate "Example: pct set 101 -mp0 /mnt/shared,mp=/mnt/shared,,backup=0,shared=1")"
|
2025-09-06 23:35:46 +02:00
|
|
|
|
|
|
|
show_command "2" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Restart container:")" \
|
|
|
|
"pct reboot ${CUS}<container-id>${CL}" \
|
|
|
|
"$(translate "Required to activate the mount point.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
show_command "3" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Verify mount inside container:")" \
|
|
|
|
"pct enter ${CUS}<container-id>${CL}
|
|
|
|
df -h | grep ${CUS}/container/path${CL}" \
|
|
|
|
"$(translate "Check if the directory is mounted.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
show_command "4" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Remove mount point (if needed):")" \
|
|
|
|
"pct set ${CUS}<container-id>${CL} --delete mp0" \
|
|
|
|
"$(translate "Removes the mount point. Use mp1, mp2, etc. for other mounts.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
echo -e "${BOR}"
|
2025-09-10 13:35:16 +02:00
|
|
|
echo -e "${BOLD}$(translate "Notes:")${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "Mount indices:")${CL} ${BL}Use mp0, mp1, mp2, etc. for multiple mounts${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "Permissions:")${CL} ${BL}May need adjustment depending on directory type${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "Container types:")${CL} ${BL}Works with both privileged and unprivileged containers${CL}"
|
2025-09-06 23:35:46 +02:00
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
2025-08-22 18:05:14 +02:00
|
|
|
show_nfs_server_help() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_title "$(translate "NFS Server Installation")"
|
2025-08-22 18:05:14 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_info2 "$(translate "How to install and configure an NFS server in an LXC container.")"
|
2025-08-22 18:05:14 +02:00
|
|
|
echo -e
|
|
|
|
|
|
|
|
show_command "1" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Update and install packages:")" \
|
|
|
|
"apt-get update && apt-get install -y nfs-kernel-server" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"" \
|
|
|
|
""
|
2025-09-06 23:35:46 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "2" \
|
|
|
|
"$(translate "Create export directory:")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"mkdir -p ${CUS}/mnt/nfs_export${CL}" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Replace with your preferred path.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "3" \
|
|
|
|
"$(translate "Set directory permissions:")" \
|
|
|
|
"chmod 755 ${CUS}/mnt/nfs_export${CL}" \
|
|
|
|
"" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:46:02 +02:00
|
|
|
show_command "4.1" \
|
|
|
|
"$(translate "Configure exports (safe root_squash):")" \
|
|
|
|
"echo '${CUS}/mnt/nfs_export${CL} ${CUS}192.168.1.0/24${CL}(rw,sync,no_subtree_check,root_squash)' >> /etc/exports" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Replace directory path and network range.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
2025-09-10 13:46:02 +02:00
|
|
|
|
|
|
|
show_command "4.2" \
|
2025-09-10 13:47:13 +02:00
|
|
|
"$(translate "Or Configure exports (map all users):")" \
|
2025-09-10 13:46:02 +02:00
|
|
|
"echo '${CUS}/mnt/nfs_export${CL} ${CUS}192.168.1.0/24${CL}(rw,sync,no_subtree_check,all_squash,anonuid=0,anongid=0)' >> /etc/exports" \
|
|
|
|
"$(translate "Replace directory path and network range.")" \
|
|
|
|
""
|
|
|
|
|
2025-08-22 18:05:14 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "5" \
|
|
|
|
"$(translate "Apply configuration:")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"exportfs -ra" \
|
|
|
|
"" \
|
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "6" \
|
|
|
|
"$(translate "Start and enable service:")" \
|
|
|
|
"systemctl restart nfs-kernel-server
|
|
|
|
systemctl enable nfs-kernel-server" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"" \
|
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "7" \
|
|
|
|
"$(translate "Verify exports:")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"showmount -e localhost" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Shows available NFS exports.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
echo -e "${BOR}"
|
2025-09-10 13:35:16 +02:00
|
|
|
echo -e "${BOLD}$(translate "Export Options:")${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "rw:")${CL} ${BL}Read-write access${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "sync:")${CL} ${BL}Synchronous writes${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "no_subtree_check:")${CL} ${BL}Improves performance${CL}"
|
2025-08-22 18:05:14 +02:00
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
|
|
|
show_samba_server_help() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_title "$(translate "Samba Server Installation")"
|
2025-08-22 18:05:14 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_info2 "$(translate "How to install and configure a Samba server in an LXC container.")"
|
2025-08-22 18:05:14 +02:00
|
|
|
echo -e
|
|
|
|
|
|
|
|
show_command "1" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Update and install packages:")" \
|
|
|
|
"apt-get update && apt-get install -y samba" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"" \
|
|
|
|
""
|
|
|
|
|
|
|
|
show_command "2" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Create share directory:")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"mkdir -p ${CUS}/mnt/samba_share${CL}" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Replace with your preferred path.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "3" \
|
2025-09-06 23:35:46 +02:00
|
|
|
"$(translate "Set directory permissions:")" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"chmod 755 ${CUS}/mnt/samba_share${CL}" \
|
|
|
|
"" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "4" \
|
|
|
|
"$(translate "Create Samba user:")" \
|
|
|
|
"adduser ${CUS}sambauser${CL}
|
|
|
|
smbpasswd -a ${CUS}sambauser${CL}" \
|
|
|
|
"$(translate "Replace with your username. You'll be prompted for password.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "5" \
|
|
|
|
"$(translate "Configure share:")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"cat >> /etc/samba/smb.conf << EOF
|
|
|
|
[shared]
|
|
|
|
comment = Shared folder
|
|
|
|
path = ${CUS}/mnt/samba_share${CL}
|
|
|
|
read only = no
|
|
|
|
browseable = yes
|
2025-09-10 13:35:16 +02:00
|
|
|
valid users = ${CUS}sambauser${CL}
|
2025-08-22 18:05:14 +02:00
|
|
|
EOF" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Replace path and username.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "6" \
|
|
|
|
"$(translate "Restart and enable service:")" \
|
|
|
|
"systemctl restart smbd
|
|
|
|
systemctl enable smbd" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"" \
|
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "7" \
|
|
|
|
"$(translate "Test configuration:")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"smbclient -L localhost -U ${CUS}sambauser${CL}" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Lists available shares. You'll be prompted for password.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
echo -e "${BOR}"
|
|
|
|
echo -e "${BOLD}$(translate "Connection Examples:")${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "Windows:")${CL} ${YW}\\\\<server-ip>\\shared${CL}"
|
|
|
|
echo -e "${TAB}${BGN}$(translate "Linux:")${CL} ${YW}smbclient //server-ip/shared -U sambauser${CL}"
|
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
|
|
|
show_nfs_client_help() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_title "$(translate "NFS Client Configuration")"
|
2025-08-22 18:05:14 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_info2 "$(translate "How to configure an NFS client in an LXC container.")"
|
2025-09-06 23:59:23 +02:00
|
|
|
echo -e
|
2025-08-22 18:05:14 +02:00
|
|
|
|
|
|
|
show_command "1" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Update and install packages:")" \
|
|
|
|
"apt-get update && apt-get install -y nfs-common" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"" \
|
|
|
|
""
|
2025-09-10 13:35:16 +02:00
|
|
|
|
2025-08-22 18:05:14 +02:00
|
|
|
show_command "2" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Create mount point:")" \
|
|
|
|
"mkdir -p ${CUS}/mnt/nfsmount${CL}" \
|
|
|
|
"$(translate "Replace with your preferred path.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
show_command "3" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Mount NFS share:")" \
|
|
|
|
"mount -t nfs ${CUS}192.168.1.100${CL}:${CUS}/mnt/nfs_export${CL} ${CUS}/mnt/nfsmount${CL}" \
|
|
|
|
"$(translate "Replace server IP and paths.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
show_command "4" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Test access:")" \
|
|
|
|
"ls -la ${CUS}/mnt/nfsmount${CL}" \
|
|
|
|
"$(translate "Verify you can access the mounted share.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
show_command "5" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Make permanent (optional):")" \
|
|
|
|
"echo '${CUS}192.168.1.100${CL}:${CUS}/path/to/share${CL} ${CUS}/mnt/nfs_share${CL} nfs4 rw,hard,intr,_netdev,rsize=1048576,wsize=1048576,timeo=600,retrans=2 0 0' >> /etc/fstab" \
|
|
|
|
"$(translate "Replace with your server IP and paths.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "6" \
|
|
|
|
"$(translate "Verify mount:")" \
|
|
|
|
"df -h | grep nfs" \
|
|
|
|
"$(translate "Shows NFS mounts.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
|
|
|
show_samba_client_help() {
|
|
|
|
clear
|
|
|
|
show_proxmenux_logo
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_title "$(translate "Samba Client Configuration")"
|
2025-08-22 18:05:14 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
msg_info2 "$(translate "How to configure a Samba client in an LXC container.")"
|
2025-08-22 18:05:14 +02:00
|
|
|
echo -e
|
|
|
|
|
|
|
|
show_command "1" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Update and install packages:")" \
|
|
|
|
"apt-get update && apt-get install -y cifs-utils" \
|
2025-08-22 18:05:14 +02:00
|
|
|
"" \
|
|
|
|
""
|
2025-09-10 13:35:16 +02:00
|
|
|
|
2025-08-22 18:05:14 +02:00
|
|
|
show_command "2" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Create mount point:")" \
|
|
|
|
"mkdir -p ${CUS}/mnt/sambamount${CL}" \
|
|
|
|
"$(translate "Replace with your preferred path.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
2025-09-06 23:35:46 +02:00
|
|
|
|
2025-08-22 18:05:14 +02:00
|
|
|
show_command "3" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Mount Samba share:")" \
|
|
|
|
"mount -t cifs //${CUS}192.168.1.100${CL}/${CUS}shared${CL} ${CUS}/mnt/sambamount${CL} -o username=${CUS}sambauser${CL}" \
|
|
|
|
"$(translate "Replace server IP, share name and username. You'll be prompted for password.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
|
|
|
show_command "4" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Test access:")" \
|
|
|
|
"ls -la ${CUS}/mnt/sambamount${CL}" \
|
|
|
|
"$(translate "Verify you can access the mounted share.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
2025-09-06 23:35:46 +02:00
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "5" \
|
|
|
|
"$(translate "Create credentials file (optional):")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
"cat > /etc/samba/credentials << EOF
|
|
|
|
username=${CUS}sambauser${CL}
|
|
|
|
password=${CUS}your_password${CL}
|
|
|
|
EOF
|
|
|
|
chmod 600 /etc/samba/credentials" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"$(translate "Secure way to store credentials.")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "6" \
|
|
|
|
"$(translate "Mount with credentials file:")" \
|
|
|
|
"mount -t cifs //${CUS}192.168.1.100${CL}/${CUS}shared${CL} ${CUS}/mnt/sambamount${CL} -o credentials=/etc/samba/credentials" \
|
|
|
|
"$(translate "No password prompt needed.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "7" \
|
|
|
|
"$(translate "Make permanent (optional):")" \
|
|
|
|
"echo '//${CUS}192.168.1.100${CL}/${CUS}shared${CL} ${CUS}/mnt/sambamount${CL} cifs credentials=/etc/samba/credentials,_netdev 0 0' >> /etc/fstab" \
|
|
|
|
"$(translate "Replace with your values.")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
""
|
|
|
|
|
2025-09-10 13:35:16 +02:00
|
|
|
show_command "8" \
|
|
|
|
"$(translate "Verify mount:")" \
|
|
|
|
"df -h | grep cifs" \
|
|
|
|
"$(translate "Shows CIFS/Samba mounts.")" \
|
|
|
|
""
|
2025-08-22 18:05:14 +02:00
|
|
|
|
|
|
|
echo -e ""
|
|
|
|
msg_success "$(translate "Press Enter to return to menu...")"
|
|
|
|
read -r
|
|
|
|
}
|
|
|
|
|
|
|
|
show_help_menu() {
|
|
|
|
while true; do
|
|
|
|
CHOICE=$(dialog --title "$(translate "Help & Information")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
--menu "$(translate "Select help topic:")" 24 80 14 \
|
2025-08-22 18:05:14 +02:00
|
|
|
"0" "$(translate "How to Access an LXC Terminal")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
"1" "$(translate "Mount Remote Resources on Proxmox Host")" \
|
|
|
|
"2" "$(translate "Mount Host Directory to LXC Container")" \
|
2025-09-10 13:35:16 +02:00
|
|
|
"3" "$(translate "NFS Server Installation")" \
|
|
|
|
"4" "$(translate "Samba Server Installation")" \
|
|
|
|
"5" "$(translate "NFS Client Configuration")" \
|
|
|
|
"6" "$(translate "Samba Client Configuration")" \
|
2025-09-06 23:35:46 +02:00
|
|
|
"7" "$(translate "Return to Main Menu")" \
|
2025-08-22 18:05:14 +02:00
|
|
|
3>&1 1>&2 2>&3)
|
|
|
|
|
|
|
|
case $CHOICE in
|
|
|
|
0) show_how_to_enter_lxc ;;
|
2025-09-06 23:35:46 +02:00
|
|
|
1) show_host_mount_resources_help ;;
|
|
|
|
2) show_host_to_lxc_mount_help ;;
|
|
|
|
3) show_nfs_server_help ;;
|
|
|
|
4) show_samba_server_help ;;
|
|
|
|
5) show_nfs_client_help ;;
|
|
|
|
6) show_samba_client_help ;;
|
|
|
|
7) return ;;
|
2025-08-22 18:05:14 +02:00
|
|
|
*) return ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
2025-09-06 23:35:46 +02:00
|
|
|
show_help_menu
|