From 998efa46af0174b9fe00ca0578f890965b2ceb61 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Thu, 5 Oct 2023 18:07:08 +0200 Subject: [PATCH] Test for logon_failure --- .templates/00-smb_mounts.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.templates/00-smb_mounts.sh b/.templates/00-smb_mounts.sh index 3cce95bc4..143503596 100755 --- a/.templates/00-smb_mounts.sh +++ b/.templates/00-smb_mounts.sh @@ -109,8 +109,13 @@ if bashio::config.has_value 'networkdisks'; then # Are credentials correct echo "... testing credentials" - if ! smbclient -t 2 -L "$disk" -U "$USERNAME%$PASSWORD" "$DOMAINCLIENT" &>/dev/null; then - bashio::log.fatal "Incorrect Username, Password, or share path ! Script will stop." + if ! smbclient -t 2 -L "$disk" -U "$USERNAME%$PASSWORD" "$DOMAINCLIENT" &>/output; then + if [[ "$(cat /output)" == *"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 fi