From 3b3452642141999fdf9fa716774ffd8fc4186a67 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 29 Apr 2021 14:51:18 +0200 Subject: [PATCH] Update 92-smb_mounts_v1.3.sh --- .../rootfs/etc/cont-init.d/92-smb_mounts_v1.3.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.3.sh b/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.3.sh index 21fa72e47..5d69002db 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.3.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.3.sh @@ -35,11 +35,17 @@ if bashio::config.has_value 'networkdisks'; then mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false #If mounting failed, tries to force uid/gid 0/0 - if [ $MOUNTED = true ]; then + if [ $MOUNTED = false ]; then bashio::log.info "... trying to force uid 0 gid 0" mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=0,gid=0,forceuid,forcegid,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname 2>ERRORCODE && MOUNTED=true || MOUNTED=false fi - + + #If mounting failed, no force uid/gid 0/0 + if [ $MOUNTED = false ]; then + bashio::log.info "... trying to force uid 0 gid 0" + mount -t cifs -o rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noforceuid,noforcegid,forceuid,forcegid,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"