mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Update 00-smb_mounts.sh
This commit is contained in:
@@ -109,13 +109,14 @@ if bashio::config.has_value 'networkdisks'; then
|
||||
|
||||
# Are credentials correct
|
||||
echo "... testing credentials"
|
||||
if ! smbclient -t 2 -L "$disk" -U "$USERNAME"%"$PASSWORD" "$DOMAINCLIENT" 2>/output >/dev/null; then
|
||||
if [[ "$(cat /output)" == *"LOGON_FAILURE"* ]]; then
|
||||
OUTPUT="$(smbclient -t 2 -L "$disk" -U "$USERNAME"%"$PASSWORD" "$DOMAINCLIENT" -c "exit" 2>&1"
|
||||
if echo "$OUTPUT" | grep -q "LOGON_FAILURE"; then
|
||||
bashio::log.fatal "Incorrect Username, Password, or Domain! Script will stop."
|
||||
else
|
||||
bashio::log.fatal "Incorrect path? Error : $(cat /output). Script will stop."
|
||||
fi
|
||||
rm /output
|
||||
touch ERRORCODE
|
||||
continue
|
||||
elif echo "$OUTPUT" | grep -q "tree connect failed"; then
|
||||
echo "... testing path"
|
||||
bashio::log.fatal "Invalid or inaccessible SMB path. Script will stop."
|
||||
touch ERRORCODE
|
||||
continue
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user