From a886af1d87234b8ca311bb059ad0dd87ecbdacca Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 6 Sep 2025 20:48:37 +0200 Subject: [PATCH] Update samba_client.sh --- scripts/share/samba_client.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/share/samba_client.sh b/scripts/share/samba_client.sh index aec9e95..b4ab9c1 100644 --- a/scripts/share/samba_client.sh +++ b/scripts/share/samba_client.sh @@ -573,12 +573,19 @@ EOF select_mount_point() { while true; do METHOD=$(whiptail --title "$(translate "Select Mount Point")" --menu "$(translate "Where do you want to mount the Samba share?")" 15 70 3 \ - "existing" "$(translate "Select from existing folders in /mnt")" \ - "new" "$(translate "Create new folder in /mnt")" \ - "custom" "$(translate "Enter custom path")" 3>&1 1>&2 2>&3) + "1" "$(translate "Create new folder in /mnt")" \ + "2" "$(translate "Select from existing folders in /mnt")" \ + "3" "$(translate "Enter custom path")" 3>&1 1>&2 2>&3) case "$METHOD" in - existing) + 1) + FOLDER_NAME=$(whiptail --inputbox "$(translate "Enter new folder name:")" 10 60 "${SAMBA_SHARE}" --title "$(translate "New Folder in /mnt")" 3>&1 1>&2 2>&3) + if [[ -n "$FOLDER_NAME" ]]; then + MOUNT_POINT="/mnt/$FOLDER_NAME" + return 0 + fi + ;; + 2) DIRS=$(pct exec "$CTID" -- find /mnt -maxdepth 1 -mindepth 1 -type d 2>/dev/null) if [[ -z "$DIRS" ]]; then @@ -613,14 +620,7 @@ select_mount_point() { return 0 fi ;; - new) - FOLDER_NAME=$(whiptail --inputbox "$(translate "Enter new folder name:")" 10 60 "${SAMBA_SHARE}" --title "$(translate "New Folder in /mnt")" 3>&1 1>&2 2>&3) - if [[ -n "$FOLDER_NAME" ]]; then - MOUNT_POINT="/mnt/$FOLDER_NAME" - return 0 - fi - ;; - custom) + 3) MOUNT_POINT=$(whiptail --inputbox "$(translate "Enter full path for mount point:")" 10 70 "/mnt/samba_share" --title "$(translate "Custom Path")" 3>&1 1>&2 2>&3) if [[ -n "$MOUNT_POINT" ]]; then return 0