mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-02 08:06:17 +00:00
update menu shared
This commit is contained in:
@@ -232,9 +232,8 @@ pmx_select_host_mount_point() {
|
||||
local choice folder_name result existing_dirs mount_point
|
||||
|
||||
while true; do
|
||||
choice=$(dialog --backtitle "ProxMenux" --title "$title" --menu "$(translate "Where do you want the host folder?")" 16 76 3 \
|
||||
choice=$(dialog --backtitle "ProxMenux" --title "$title" --menu "\n$(translate "Where do you want the host folder?")" 16 76 3 \
|
||||
"1" "$(translate "Create new folder in /mnt")" \
|
||||
"2" "$(translate "Use existing folder")" \
|
||||
"3" "$(translate "Enter custom path")" 3>&1 1>&2 2>&3) || { echo ""; return 1; }
|
||||
|
||||
case "$choice" in
|
||||
@@ -247,23 +246,6 @@ pmx_select_host_mount_point() {
|
||||
;;
|
||||
|
||||
2)
|
||||
existing_dirs=($(ls -1d /mnt/*/ 2>/dev/null | sed 's:/$::'))
|
||||
if [[ ${#existing_dirs[@]} -eq 0 ]]; then
|
||||
dialog --msgbox "$(translate "No existing folders found in /mnt")" 8 60
|
||||
continue
|
||||
fi
|
||||
mount_point=$(dialog --backtitle "ProxMenux" --title "$(translate "Select Existing Folder")" \
|
||||
--menu "$(translate "Choose a folder in /mnt:")" 20 70 10 \
|
||||
$(for d in "${existing_dirs[@]}"; do echo "$d" "$(basename "$d")"; done) \
|
||||
3>&1 1>&2 2>&3) || continue
|
||||
|
||||
if [[ "$context" =~ ^(nfs|samba)$ ]] && [[ -n "$(ls -A "$mount_point" 2>/dev/null)" ]]; then
|
||||
dialog --backtitle "ProxMenux" --yesno "$(translate "Warning: The selected folder is not empty. Files may not be accessible once the network share is mounted. Proceed anyway?")" 12 70 || continue
|
||||
fi
|
||||
echo "$mount_point"; return 0
|
||||
;;
|
||||
|
||||
3)
|
||||
clear
|
||||
result=$(whiptail --inputbox "$(translate "Enter full path:")" 10 80 "$default_path" --title "$(translate "Custom Path")" 3>&1 1>&2 2>&3) || { echo ""; return 1; }
|
||||
[[ -z "$result" ]] && continue
|
||||
@@ -279,12 +261,6 @@ pmx_select_host_mount_point() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
select_host_directory() {
|
||||
local method choice result
|
||||
|
||||
|
Reference in New Issue
Block a user