Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2020-09-13 20:18:02 +0300
committerGitHub <noreply@github.com>2020-09-13 20:18:02 +0300
commiteda50026fd10430dd8d5c6b0eb2bb28eb6deba6f (patch)
tree7ba175e906a1abee1165b976ef99933889c533ac /apps/smbmount.sh
parentfa3e1e5d5a60331ed662d5d952e9203082d239a4 (diff)
create input_box_flow (#1449)
Co-authored-by: Daniel Hansson <github@hanssonit.se>
Diffstat (limited to 'apps/smbmount.sh')
-rw-r--r--apps/smbmount.sh70
1 files changed, 8 insertions, 62 deletions
diff --git a/apps/smbmount.sh b/apps/smbmount.sh
index 2b0e0682..6d849eee 100644
--- a/apps/smbmount.sh
+++ b/apps/smbmount.sh
@@ -81,41 +81,14 @@ If you really want to mount more, you can simply download the smb-mount script d
fi
# Enter SMB-server and Share-name
-while :
-do
- SERVER_SHARE_NAME=$(input_box "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$SUBTITLE")
- if ! yesno_box_yes "Is this correct? $SERVER_SHARE_NAME" "$SUBTITLE"
- then
- msg_box "It seems like your weren't satisfied by the PATH you entered. Please try again." "$SUBTITLE"
- else
- SERVER_SHARE_NAME=${SERVER_SHARE_NAME// /\\040}
- break
- fi
-done
+SERVER_SHARE_NAME=$(input_box_flow "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$SUBTITLE")
+SERVER_SHARE_NAME=${SERVER_SHARE_NAME// /\\040}
# Enter the SMB-user
-while :
-do
- SMB_USER=$(input_box "Please enter the username of the SMB-user" "$SUBTITLE")
- if ! yesno_box_yes "Is this correct? $SMB_USER" "$SUBTITLE"
- then
- msg_box "It seems like your weren't satisfied by the SMB-user you entered. Please try again." "$SUBTITLE"
- else
- break
- fi
-done
+SMB_USER=$(input_box_flow "Please enter the username of the SMB-user" "$SUBTITLE")
# Enter the password of the SMB-user
-while :
-do
- SMB_PASSWORD=$(input_box "Please enter the password of the SMB-user $SMB_USER." "$SUBTITLE")
- if ! yesno_box_yes "Is this correct? $SMB_PASSWORD" "$SUBTITLE"
- then
- msg_box "It seems like your weren't satisfied by the password for the SMB-user you entered. Please try again." "$SUBTITLE"
- else
- break
- fi
-done
+SMB_PASSWORD=$(input_box_flow "Please enter the password of the SMB-user $SMB_USER." "$SUBTITLE")
# Write everything to /etc/fstab, mount and connect external storage
count=1
@@ -371,45 +344,18 @@ case "$choice" in
*"Share"*)
clear
# Enter SMB-server and Share-name
- while :
- do
- SERVER_SHARE_NAME=$(input_box "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$SUBTITLE")
- if ! yesno_box_yes "Is this correct? $SERVER_SHARE_NAME" "$SUBTITLE"
- then
- msg_box "It seems like your weren't satisfied by the PATH you entered. Please try again." "$SUBTITLE"
- else
- SERVER_SHARE_NAME=${SERVER_SHARE_NAME// /\\040}
- break
- fi
- done
+ SERVER_SHARE_NAME=$(input_box_flow "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$SUBTITLE")
+ SERVER_SHARE_NAME=${SERVER_SHARE_NAME// /\\040}
;;&
*"Username"*)
clear
# Enter the SMB-user
- while :
- do
- SMB_USER=$(input_box "Please enter the username of the SMB-user" "$SUBTITLE")
- if ! yesno_box_yes "Is this correct? $SMB_USER" "$SUBTITLE"
- then
- msg_box "It seems like your weren't satisfied by the SMB-user you entered. Please try again." "$SUBTITLE"
- else
- break
- fi
- done
+ SMB_USER=$(input_box_flow "Please enter the username of the SMB-user" "$SUBTITLE")
;;&
*"Password"*)
clear
# Enter the password of the SMB-user
- while :
- do
- SMB_PASSWORD=$(input_box "Please enter the password of the SMB-user $SMB_USER." "$SUBTITLE")
- if ! yesno_box_yes "Is this correct? $SMB_PASSWORD" "$SUBTITLE"
- then
- msg_box "It seems like your weren't satisfied by the password for the SMB-user you entered. Please try again." "$SUBTITLE"
- else
- break
- fi
- done
+ SMB_PASSWORD=$(input_box_flow "Please enter the password of the SMB-user $SMB_USER." "$SUBTITLE")
;;&
"")
return