mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 13:24:04 +02:00
Upgrade smb code to v1.6
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 #
|
||||||
#################
|
#################
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 #
|
||||||
###################
|
###################
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 #
|
||||||
##############
|
##############
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user