mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-25 10:11:53 +02:00
correct log message
This commit is contained in:
@@ -11,6 +11,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
MOREDISKS=$(bashio::config 'networkdisks')
|
MOREDISKS=$(bashio::config 'networkdisks')
|
||||||
CIFS_USERNAME=$(bashio::config 'cifsusername')
|
CIFS_USERNAME=$(bashio::config 'cifsusername')
|
||||||
CIFS_PASSWORD=$(bashio::config 'cifspassword')
|
CIFS_PASSWORD=$(bashio::config 'cifspassword')
|
||||||
|
MOUNTOPTIONS=""
|
||||||
|
|
||||||
if bashio::config.has_value 'cifsdomain'; then
|
if bashio::config.has_value 'cifsdomain'; then
|
||||||
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
|
DOMAIN=",domain=$(bashio::config 'cifsdomain')"
|
||||||
@@ -43,10 +44,12 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
for SMBVERS in ",vers=2.1" ",vers=3.0" ",vers=1.0" ",vers=3.1.1" ",vers=2.0" ",vers=3.0.2"
|
for SMBVERS in ",vers=2.1" ",vers=3.0" ",vers=1.0" ",vers=3.1.1" ",vers=2.0" ",vers=3.0.2"
|
||||||
do
|
do
|
||||||
bashio::log.warning "... trying to mount with $SMBVERS"
|
bashio::log.warning "... trying to mount with $SMBVERS"
|
||||||
|
MOUNTOPTIONS=" $SMBVERS"
|
||||||
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username="$CIFS_USERNAME",password="${CIFS_PASSWORD}"$DOMAIN$SMBVERS $disk /mnt/$diskname && break
|
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username="$CIFS_USERNAME",password="${CIFS_PASSWORD}"$DOMAIN$SMBVERS $disk /mnt/$diskname && break
|
||||||
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5"
|
for SECVERS in ",sec=ntlmi" ",sec=ntlmv2" ",sec=ntlmv2i" ",sec=ntlmssp" ",sec=ntlmsspi" ",sec=ntlm" ",sec=krb5i" ",sec=krb5"
|
||||||
do
|
do
|
||||||
bashio::log.warning "... trying to mount with $SMBVERS $SECVERS"
|
bashio::log.warning "... trying to mount with $SMBVERS $SECVERS"
|
||||||
|
MOUNTOPTIONS=" $SMBVERS $SECVERS"
|
||||||
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username="$CIFS_USERNAME",password="${CIFS_PASSWORD}"$DOMAIN$SMBVERS$SECVERS $disk /mnt/$diskname && break 2 && break
|
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username="$CIFS_USERNAME",password="${CIFS_PASSWORD}"$DOMAIN$SMBVERS$SECVERS $disk /mnt/$diskname && break 2 && break
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
@@ -55,7 +58,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
# Messages
|
# Messages
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
#Test write permissions
|
#Test write permissions
|
||||||
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && bashio::log.info "... $disk successfully mounted to /mnt/$diskname" || bashio::log.fatal "Unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
|
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && bashio::log.info "... $disk successfully mounted to /mnt/$diskname$MOUNTOPTIONS" || bashio::log.fatal "Unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"
|
||||||
else
|
else
|
||||||
# message if still fail
|
# message if still fail
|
||||||
bashio::log.fatal "Unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" # Mount share
|
bashio::log.fatal "Unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID" # Mount share
|
||||||
@@ -63,7 +66,3 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user