Skip to content

Commit b85c42d

Browse files
authored
Possible fix for first SMB-bug (#1076)
1 parent e3e9de4 commit b85c42d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

apps/smbmount.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ root_check
1919
# Install cifs-utils
2020
install_if_not cifs-utils
2121

22+
# Make sure, that name resolution works
23+
install_if_not winbind
24+
if [ "$(grep "^hosts:" /etc/nsswitch.conf | grep wins)" == "" ]
25+
then
26+
sed -i '/^hosts/ s/$/ wins/' /etc/nsswitch.conf
27+
fi
28+
2229
# Secure fstab
2330
if [ "$(stat -c %a /etc/fstab)" != "600" ]
2431
then
@@ -39,7 +46,7 @@ fi
3946
# Enter SMB-server and Share-name
4047
while true
4148
do
42-
SERVER_SHARE_NAME=$(whiptail --inputbox "Please enter the server and Share-name like this:\n//Server/Share" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3)
49+
SERVER_SHARE_NAME=$(whiptail --inputbox "Please enter the server and Share-name like this:\n//Server/Share\nor\n//IP-address/Share" "$WT_HEIGHT" "$WT_WIDTH" 3>&1 1>&2 2>&3)
4350
if [[ "no" == $(ask_yes_or_no "Is this correct? $SERVER_SHARE_NAME") ]]
4451
then
4552
msg_box "It seems like your weren't satisfied by the PATH you entered. Please try again."
@@ -90,7 +97,7 @@ do
9097
if [[ ! $(findmnt -M "$SMBSHARES/$count") ]]
9198
then
9299
# If not remove this line from fstab
93-
msg_box "It seems like the mount wasn't successful. It will get deleted now. Please try again.\nAs a hint: you might fix the connection problem by enabling SMB3 on your SMB-server."
100+
msg_box "It seems like the mount wasn't successful. It will get deleted now. Please try again.\nAs a hint:\n- you might fix the connection problem by enabling SMB3 on your SMB-server.\n- You could also try to use the IP-address of the SMB-server instead of the Server-name, if not already done.\n- Please also make sure, that 'ping IP-address' of your SMB-Server from your Nextcloud-instance works."
94101
sed -i "/$SMBSHARES_SED\/$count/d" /etc/fstab
95102
break
96103
else

0 commit comments

Comments
 (0)