Upgrade smb code to v1.6

This commit is contained in:
Alexandre
2021-10-23 12:50:51 +02:00
parent bf4190f1ae
commit df1d84eca3
17 changed files with 156 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -65,7 +65,7 @@ if bashio::config.has_value 'localdisks'; then
fi || true fi || true
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -91,10 +91,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname
@@ -142,6 +150,7 @@ if bashio::config.has_value 'networkdisks'; then
fi fi
################# #################
# NGINX SETTING # # NGINX SETTING #
################# #################

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -64,7 +64,7 @@ if bashio::config.has_value 'localdisks'; then
fi || true fi || true
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -90,10 +90,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname
@@ -141,6 +149,7 @@ if bashio::config.has_value 'networkdisks'; then
fi fi
################### ###################
# SSL CONFIG v1.0 # # SSL CONFIG v1.0 #
################### ###################

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -66,7 +66,7 @@ if bashio::config.has_value 'localdisks'; then
fi || true fi || true
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -92,10 +92,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname
@@ -143,6 +151,7 @@ if bashio::config.has_value 'networkdisks'; then
fi fi
############## ##############
# LAUNCH APP # # LAUNCH APP #
############## ##############

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname

View File

@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
######################### #########################
# MOUNT SMB SHARES v1.5 # # MOUNT SMB SHARES v1.6 #
######################### #########################
if bashio::config.has_value 'networkdisks'; then if bashio::config.has_value 'networkdisks'; then
@@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then
# Mounting disks # Mounting disks
for disk in ${MOREDISKS//,/ }; do # Separate comma separated values for disk in ${MOREDISKS//,/ }; do # Separate comma separated values
# Clean name of network share # Clean name of network share
disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name
diskname=${disk//\\//} #replace \ with / diskname=${disk//\\//} #replace \ with /
diskname=${diskname##*/} # Get only last part of the name diskname=${diskname##*/} # Get only last part of the name
# Data validation
if [[ ! $ip =~ ^.*+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[/]+.*+$ ]]; then
bashio::log.fatal "The structure of your <networkdisks> doesn't seem correct, please use a structure like //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
exit 1
fi
# Prepare mount point # Prepare mount point
mkdir -p /mnt/$diskname mkdir -p /mnt/$diskname
chown -R root:root /mnt/$diskname chown -R root:root /mnt/$diskname