mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-27 02:44:05 +02: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_USERNAME=$(bashio::config 'cifsusername')
|
||||||
CIFS_PASSWORD=$(bashio::config 'cifspassword')
|
CIFS_PASSWORD=$(bashio::config 'cifspassword')
|
||||||
|
|
||||||
|
if bashio::config.has_value 'domain'; then
|
||||||
|
DOMAIN=",domain=$(bashio::config 'domain')"
|
||||||
|
else
|
||||||
|
DOMAIN=""
|
||||||
|
fi
|
||||||
|
|
||||||
# Mounting disks
|
# Mounting disks
|
||||||
for disk in ${MOREDISKS//,/ } # Separate comma separated values
|
for disk in ${MOREDISKS//,/ } # Separate comma separated values
|
||||||
do
|
do
|
||||||
@@ -20,42 +26,42 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
diskname=${diskname##*/} # Get only last part of the name
|
diskname=${diskname##*/} # Get only last part of the name
|
||||||
mkdir -p /mnt/$diskname # Create dir
|
mkdir -p /mnt/$diskname # Create dir
|
||||||
chown -R root:root /mnt/$diskname # Permissions
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$diskname"
|
||||||
|
|
||||||
# if Fail test smbv1
|
# if Fail test smbv1
|
||||||
if [ $? != 0 ]; then
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$diskname with smbv1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test smbv2.1
|
# Test smbv2.1
|
||||||
if [ $? != 0 ]; then
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$disk name with smbv2.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test smbv3
|
# Test smbv3
|
||||||
if [ $? != 0 ]; then
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$disk name with smbv3"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test ntlmv2
|
# Test ntlmv2
|
||||||
if [ $? != 0 ]; then
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$disk name with ntlmv2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test ntlmv2 and smbv3
|
# Test ntlmv2 and smbv3
|
||||||
if [ $? != 0 ]; then
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$disk name with ntlmv2 and smbv2.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test ntlmv2 and smbv3
|
# Test ntlmv2 and smbv3
|
||||||
if [ $? != 0 ]; then
|
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"
|
bashio::log.info "... $disk successfully mounted to /mnt/$disk name with ntlmv2 and smbv3"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user