Update 92-smb_mounts_v1.4.sh

This commit is contained in:
Alexandre
2021-10-23 07:31:23 +02:00
committed by GitHub
parent 63ab24161b
commit 331f5403ae

View File

@@ -55,14 +55,16 @@ if bashio::config.has_value 'networkdisks'; then
fi fi
# Messages # Messages
if [ $MOUNTED = true ]; then if [ $MOUNTED = true && mountpoint -q /mnt/$diskname ]; then
mountpoint -q /mnt/$diskname && bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || bashio::log.fatal "Something went wrong with the disk mount!" bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS"
#Test write permissions #Test write permissions
touch /mnt/$diskname/testaze && rm /mnt/$diskname/testaze && bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || bashio::log.fatal "Disk is mounted, however 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 with options $SMBVERS$SECVERS" || bashio::log.fatal "Disk is mounted, however 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
bashio::log.fatal "Error read : $(<ERRORCODE)" # Mount share bashio::log.fatal "Error read : $(<ERRORCODE)"
umount /mnt/$diskname 2>/dev/null || true # Remove folder
rm /mnt/$diskname # Remove folder
rm ERRORCODE rm ERRORCODE
fi fi