mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-17 14:21:49 +02:00
Update 00-smb_mounts.sh
This commit is contained in:
@@ -53,7 +53,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
MOUNTED=false
|
MOUNTED=false
|
||||||
|
|
||||||
# Data validation
|
# Data validation
|
||||||
if [[ ! $disk =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
|
if [[ ! "$disk" =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
|
||||||
bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future."
|
bashio::log.fatal "The structure of your \"networkdisks\" option : \"$disk\" doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2. If you don't use it, you can simply remove the text, this will avoid this error message in the future."
|
||||||
break 2
|
break 2
|
||||||
fi
|
fi
|
||||||
@@ -119,6 +119,13 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
touch "/mnt/$diskname/testaze" && mv "/mnt/$diskname/testaze" "/mnt/$diskname/testaze2" && rm "/mnt/$diskname/testaze2" ||
|
touch "/mnt/$diskname/testaze" && mv "/mnt/$diskname/testaze" "/mnt/$diskname/testaze2" && rm "/mnt/$diskname/testaze2" ||
|
||||||
(umount "/mnt/$diskname" && mount -t cifs -o "iocharset=utf8,rw,file_mode=0775,dir_mode=0775,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$MOUNTOPTIONS,noserverino" "$disk" /mnt/"$diskname" && bashio::log.warning "noserverino option used")
|
(umount "/mnt/$diskname" && mount -t cifs -o "iocharset=utf8,rw,file_mode=0775,dir_mode=0775,username=$CIFS_USERNAME,password=${CIFS_PASSWORD}$MOUNTOPTIONS,noserverino" "$disk" /mnt/"$diskname" && bashio::log.warning "noserverino option used")
|
||||||
|
|
||||||
|
# Alert if smbv1
|
||||||
|
if [[ "$MOUNTOPTIONS" == *"1.0"* ]]; then
|
||||||
|
bashio::log.warning ""
|
||||||
|
bashio::log.warning "Your smb system requires smbv1. This is an obsolete protocol. Please correct this to prevent issues."
|
||||||
|
bashio::log.warning ""
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
# Mounting failed messages
|
# Mounting failed messages
|
||||||
bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID"
|
bashio::log.fatal "Error, unable to mount $disk to /mnt/$diskname with username $CIFS_USERNAME, $CIFS_PASSWORD. Please check your remote share path, username, password, domain, try putting 0 in UID and GID"
|
||||||
|
|||||||
Reference in New Issue
Block a user