From 354ca3e9e7dd91ebb91a7058cb817517cc9bdc2d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 24 Apr 2021 22:26:45 +0200 Subject: [PATCH] Added domain --- .../etc/cont-init.d/92-smb_mounts_v1.2.sh | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.2.sh b/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.2.sh index 3551a73b8..9059ae71b 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.2.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.2.sh @@ -12,6 +12,12 @@ if bashio::config.has_value 'networkdisks'; then CIFS_USERNAME=$(bashio::config 'cifsusername') CIFS_PASSWORD=$(bashio::config 'cifspassword') + if bashio::config.has_value 'domain'; then + DOMAIN=",domain=$(bashio::config 'domain')" + else + DOMAIN="" + fi + # Mounting disks for disk in ${MOREDISKS//,/ } # Separate comma separated values do @@ -20,42 +26,42 @@ if bashio::config.has_value 'networkdisks'; then diskname=${diskname##*/} # Get only last part of the name mkdir -p /mnt/$diskname # Create dir chown -R root:root /mnt/$diskname # Permissions - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$diskname" # if Fail test smbv1 if [ $? != 0 ]; then - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,vers=1.0 $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,vers=1.0$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$diskname with smbv1" fi # Test smbv2.1 if [ $? != 0 ]; then - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,vers=2.1 $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,vers=2.1$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$disk name with smbv2.1" fi # Test smbv3 if [ $? != 0 ]; then - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,vers=3.0 $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,vers=3.0$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$disk name with smbv3" fi # Test ntlmv2 if [ $? != 0 ]; then - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,sec=ntlmv2 $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,sec=ntlmv2$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$disk name with ntlmv2" fi # Test ntlmv2 and smbv3 if [ $? != 0 ]; then - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,sec=ntlmv2,vers=2.1 $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,sec=ntlmv2,vers=2.1$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$disk name with ntlmv2 and smbv2.1" fi # Test ntlmv2 and smbv3 if [ $? != 0 ]; then - mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,sec=ntlmv2,vers=3 $disk /mnt/$diskname && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD,sec=ntlmv2,vers=3$DOMAIN $disk /mnt/$diskname && \ bashio::log.info "... $disk successfully mounted to /mnt/$disk name with ntlmv2 and smbv3" fi