diff --git a/.templates/00-smb_mounts.sh b/.templates/00-smb_mounts.sh index 3c14f0913..96a2e79c4 100755 --- a/.templates/00-smb_mounts.sh +++ b/.templates/00-smb_mounts.sh @@ -66,11 +66,18 @@ if bashio::config.has_value 'networkdisks'; then # Does server exists if command -v "nc" &>/dev/null; then # test if smb port is open - nc -w 1 -z "$server" 445 2>/dev/null || \ - # test with ping also if different port is used - echo "... warning : SMB port not opened, trying ping" && ping -w 1 -c 1 "$server" >/dev/null || \ - echo "... warning : ping not successful, trying smbclient" && smbclient -t 1 -L "$server" -N &>/dev/null || \ - { bashio::log.warning "Your server $server from $disk doesn't seem reachable, script will stop"; break; } + if ! nc -w 1 -z "$server" 445 2>/dev/null; then + # test with ping also if different port is used + echo "... warning : SMB port not opened, trying ping" + if ! ping -w 1 -c 1 "$server" >/dev/null; then + # Try smbclient (last as slowest) + echo "... warning : ping not successful, trying smbclient" + if ! smbclient -t 1 -L "$server" -N &>/dev/null; then + bashio::log.fatal "... your server $server from $disk doesn't seem reachable, script will stop" + break + fi + fi + fi fi # Try smbv1