mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-10-01 23:56:18 +00:00
Update share-common.func
This commit is contained in:
@@ -234,8 +234,7 @@ pmx_select_host_mount_point() {
|
|||||||
while true; do
|
while true; do
|
||||||
choice=$(whiptail --title "$title" --menu "$(translate "Where do you want the host folder?")" 16 76 3 \
|
choice=$(whiptail --title "$title" --menu "$(translate "Where do you want the host folder?")" 16 76 3 \
|
||||||
"1" "$(translate "Create new folder in /mnt")" \
|
"1" "$(translate "Create new folder in /mnt")" \
|
||||||
"2" "$(translate "Use existing folder")" \
|
"2" "$(translate "Use existing folder")" 3>&1 1>&2 2>&3) || { echo ""; return 1; }
|
||||||
"3" "$(translate "Enter custom path")" 3>&1 1>&2 2>&3) || { echo ""; return 1; }
|
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
1)
|
1)
|
||||||
@@ -246,23 +245,6 @@ pmx_select_host_mount_point() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
2)
|
2)
|
||||||
existing_dirs=($(ls -1d /mnt/*/ 2>/dev/null | sed 's:/$::'))
|
|
||||||
if [[ ${#existing_dirs[@]} -eq 0 ]]; then
|
|
||||||
whiptail --msgbox "$(translate "No existing folders found in /mnt")" 8 60
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
mount_point=$(whiptail --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
|
|
||||||
whiptail --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)
|
|
||||||
result=$(whiptail --inputbox "$(translate "Enter full path:")" 10 80 "$default_path" --title "$(translate "Custom Path")" 3>&1 1>&2 2>&3) || { echo ""; return 1; }
|
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
|
[[ -z "$result" ]] && continue
|
||||||
echo "$result"; return 0
|
echo "$result"; return 0
|
||||||
|
Reference in New Issue
Block a user