mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 04:44:05 +02:00
Update 92-smb_mounts_v1.3.sh
This commit is contained in:
@@ -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
|
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
|
fi
|
||||||
|
|
||||||
#If mounting failed, tries to mount as NFS
|
# if Fail test different smb and sec versions
|
||||||
#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 [ $MOUNTED = false ]; then
|
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"
|
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
|
||||||
@@ -71,7 +63,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
# Messages
|
# Messages
|
||||||
if [ $MOUNTED = true ]; then
|
if [ $MOUNTED = true ]; 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" || 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
|
||||||
|
|||||||
Reference in New Issue
Block a user