Update 92-smb_mounts_v1.3.sh

This commit is contained in:
Alexandre
2021-04-29 15:46:16 +02:00
committed by GitHub
parent 68d64daaf9
commit a9d234cf80

View File

@@ -46,15 +46,7 @@ if bashio::config.has_value 'networkdisks'; then
mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noforceuid,noforcegid,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
fi
#If mounting failed, tries to mount as NFS
#if [ $MOUNTED = true ]; then
# bashio::log.info "... mounts as NFS"
# disknfs=$(echo $disk | sed 's/^\///')
# disknfs=$(echo $disknfs | sed 's/^\///')
# mount -t nfs $disknfs /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false
#fi
# if Fail test different smb and sec versions
# if Fail test different smb and sec versions
if [ $MOUNTED = false ]; then
for SMBVERS in ",vers=2.1" ",vers=3.0" ",vers=1.0" ",vers=3.1.1" ",vers=2.0" ",vers=3.0.2"
do
@@ -71,7 +63,7 @@ if bashio::config.has_value 'networkdisks'; then
# Messages
if [ $MOUNTED = true ]; then
#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" || 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
# 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