mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-15 20:09:13 +02:00
Github bot : script beautyshied
This commit is contained in:
@@ -67,23 +67,23 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
if command -v "nc" &>/dev/null; then
|
if command -v "nc" &>/dev/null; then
|
||||||
# test if smb port is open
|
# test if smb port is open
|
||||||
if ! nc -w 1 -z "$server" 445 2>/dev/null; then
|
if ! nc -w 1 -z "$server" 445 2>/dev/null; then
|
||||||
# test with ping also if different port is used
|
# test with ping also if different port is used
|
||||||
echo "... warning : SMB port not opened, trying ping"
|
echo "... warning : SMB port not opened, trying ping"
|
||||||
if ! ping -w 1 -c 1 "$server" >/dev/null; then
|
if ! ping -w 1 -c 1 "$server" >/dev/null; then
|
||||||
# Try smbclient (last as slowest)
|
# Try smbclient (last as slowest)
|
||||||
echo "... warning : ping not successful, trying smbclient"
|
echo "... warning : ping not successful, trying smbclient"
|
||||||
if ! smbclient -t 1 -L "$server" -N &>/dev/null; then
|
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"
|
bashio::log.fatal "... your server $server from $disk doesn't seem reachable, script will stop"
|
||||||
break
|
break
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try smbv1
|
# Try smbv1
|
||||||
if smbclient -t 2 -L "$server" -m NT1 -N &>/dev/null; then
|
if smbclient -t 2 -L "$server" -m NT1 -N &>/dev/null; then
|
||||||
echo "... only SMBv1 is supported, trying it"
|
echo "... only SMBv1 is supported, trying it"
|
||||||
SMBDEFAULT=",vers=1.0"
|
SMBDEFAULT=",vers=1.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare mount point
|
# Prepare mount point
|
||||||
|
|||||||
Reference in New Issue
Block a user