mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-04 00:01:36 +01:00
Added domain
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user