Added domain

This commit is contained in:
Alexandre
2021-04-24 22:26:45 +02:00
committed by GitHub
parent e807a322b0
commit 354ca3e9e7

View File

@@ -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