From debd2ba734d72d12119365426e51fe7ff7b4bd54 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 00:13:12 +0000 Subject: [PATCH] Github bot : script beautyshied --- .templates/00-smb_mounts.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.templates/00-smb_mounts.sh b/.templates/00-smb_mounts.sh index 96a2e79c4..b414fc89c 100755 --- a/.templates/00-smb_mounts.sh +++ b/.templates/00-smb_mounts.sh @@ -67,23 +67,23 @@ if bashio::config.has_value 'networkdisks'; then if command -v "nc" &>/dev/null; then # test if smb port is open 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 + # 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 + fi fi # Try smbv1 if smbclient -t 2 -L "$server" -m NT1 -N &>/dev/null; then - echo "... only SMBv1 is supported, trying it" - SMBDEFAULT=",vers=1.0" + echo "... only SMBv1 is supported, trying it" + SMBDEFAULT=",vers=1.0" fi # Prepare mount point