mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
Refactor SMBv1 connection handling in script
This commit is contained in:
@@ -217,16 +217,10 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
fi
|
fi
|
||||||
continue
|
continue
|
||||||
elif echo "$OUTPUT" | grep -q "tree connect failed" || echo "$OUTPUT" | grep -q "NT_STATUS_CONNECTION_DISCONNECTED"; then
|
elif echo "$OUTPUT" | grep -q "tree connect failed" || echo "$OUTPUT" | grep -q "NT_STATUS_CONNECTION_DISCONNECTED"; then
|
||||||
echo "... testing path"
|
echo "... using SMBv1"
|
||||||
if smbclient -t 2 "$disk" -m NT1 -U "$USERNAME%$PASSWORD" -c "exit" $DOMAINCLIENT &> /dev/null; then
|
bashio::log.warning "...... share reachable only with legacy SMBv1 (NT1) negotiation. Forcing SMBv1 options."
|
||||||
bashio::log.warning "...... share reachable only with legacy SMBv1 (NT1) negotiation. Forcing SMBv1 options."
|
SMBVERS_FORCE=",vers=1.0"
|
||||||
SMBVERS_FORCE=",vers=1.0"
|
SECVERS_FORCE=",sec=ntlm"
|
||||||
SECVERS_FORCE=",sec=ntlm"
|
|
||||||
else
|
|
||||||
bashio::log.fatal "...... invalid or inaccessible SMB path. Script will stop."
|
|
||||||
touch ERRORCODE
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
elif ! echo "$OUTPUT" | grep -q "Disk"; then
|
elif ! echo "$OUTPUT" | grep -q "Disk"; then
|
||||||
echo "... testing path"
|
echo "... testing path"
|
||||||
bashio::log.fatal "...... no shares found. Invalid or inaccessible SMB path?"
|
bashio::log.fatal "...... no shares found. Invalid or inaccessible SMB path?"
|
||||||
|
|||||||
Reference in New Issue
Block a user