From 70de83ab7bd46f7469c53c5f331d7783177eeb50 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 2 Oct 2023 21:37:56 +0200 Subject: [PATCH] Update 00-smb_mounts.sh --- .templates/00-smb_mounts.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.templates/00-smb_mounts.sh b/.templates/00-smb_mounts.sh index 86db5c7b1..811f4648a 100755 --- a/.templates/00-smb_mounts.sh +++ b/.templates/00-smb_mounts.sh @@ -91,12 +91,8 @@ if bashio::config.has_value 'networkdisks'; then output="$(nmap -F $server -T5 -oG -)" if ! echo "$output" | grep 445/open &>/dev/null; then if echo "$output" | grep /open &>/dev/null; then - if ! smbclient -t 1 -L "$server" -N "$DOMAINCLIENT" &>/dev/null; then - bashio::log.fatal "... fatal : $server is reachable but SMB port not opened, stopping script" - continue - else - bashio::warning "... fatal : $server not reachable but SMB connects, you have strange security in place" - fi + bashio::log.fatal "... fatal : $server is reachable but SMB port not opened, stopping script" + continue else bashio::log.fatal "... fatal : $server not reachable, is it correct" continue @@ -111,7 +107,7 @@ if bashio::config.has_value 'networkdisks'; then fi # Should there be a workgroup - echo "... testing credentials" + echo "... testing workgroup" if ! smbclient -t 2 -L $disk -N "$DOMAINCLIENT" &>/dev/null; then bashio::log.fatal "A workgroup must perhaps be specified" continue @@ -136,7 +132,7 @@ if bashio::config.has_value 'networkdisks'; then # Test with different security versions ####################################### - for SECVERS in "" ",sec=ntlmv2" ",sec=ntlm" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=krb5i" ",sec=krb5"; do + for SECVERS in "$SECVERS" ",sec=ntlmv2" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=krb5i" ",sec=krb5" ",sec=ntlm" ",sec=ntlmv2i"; do if [ "$MOUNTED" = false ]; then mount -t cifs -o "rw,file_mode=0775,dir_mode=0775,username=$USERNAME,password=${PASSWORD},nobrl$SMBVERS$SECVERS$PUIDPGID$CHARSET$DOMAIN" "$disk" /mnt/"$diskname" 2>ERRORCODE \ && MOUNTED=true && MOUNTOPTIONS="$SMBVERS$SECVERS$PUIDPGID$CHARSET$DOMAIN" || MOUNTED=false @@ -171,7 +167,7 @@ if bashio::config.has_value 'networkdisks'; then bashio::log.fatal "Here is some debugging info :" # Provide debugging info - smbclient -t 5 -L $disk -U "$USERNAME%$PASSWORD" + smbclient -t 2 -L $disk -U "$USERNAME%$PASSWORD" # Error code mount -t cifs -o "rw,file_mode=0775,dir_mode=0775,username=$USERNAME,password=${PASSWORD},nobrl$DOMAIN" "$disk" /mnt/"$diskname" 2>ERRORCODE || MOUNTED=false