From df1d84eca3ac3d10468e696f0408ceb34cc209a2 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Sat, 23 Oct 2021 12:50:51 +0200 Subject: [PATCH] Upgrade smb code to v1.6 --- bazarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- cloudcommander/rootfs/run.sh | 11 ++++++++++- .../root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- emby/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- filebrowser/rootfs/run.sh | 11 ++++++++++- jellyfin/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- lidarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- .../rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- photoprism/rootfs/run.sh | 11 ++++++++++- plex/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- prowlarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- .../rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- radarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- readarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- sonarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- .../rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- .../rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh | 10 +++++++++- 17 files changed, 156 insertions(+), 17 deletions(-) diff --git a/bazarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/bazarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/bazarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/bazarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/cloudcommander/rootfs/run.sh b/cloudcommander/rootfs/run.sh index c5e5ccbf0..6ca071316 100644 --- a/cloudcommander/rootfs/run.sh +++ b/cloudcommander/rootfs/run.sh @@ -65,7 +65,7 @@ if bashio::config.has_value 'localdisks'; then fi || true ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -91,10 +91,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname @@ -142,6 +150,7 @@ if bashio::config.has_value 'networkdisks'; then fi + ################# # NGINX SETTING # ################# diff --git a/doublecommander/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/doublecommander/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/doublecommander/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/doublecommander/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/emby/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/emby/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/emby/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/emby/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/filebrowser/rootfs/run.sh b/filebrowser/rootfs/run.sh index 80445c06a..96a6c332e 100644 --- a/filebrowser/rootfs/run.sh +++ b/filebrowser/rootfs/run.sh @@ -64,7 +64,7 @@ if bashio::config.has_value 'localdisks'; then fi || true ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -90,10 +90,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname @@ -141,6 +149,7 @@ if bashio::config.has_value 'networkdisks'; then fi + ################### # SSL CONFIG v1.0 # ################### diff --git a/jellyfin/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/jellyfin/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/jellyfin/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/jellyfin/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/lidarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/lidarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/lidarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/lidarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/papermerge/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh b/papermerge/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/papermerge/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/papermerge/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/photoprism/rootfs/run.sh b/photoprism/rootfs/run.sh index 62579ca66..41678e712 100644 --- a/photoprism/rootfs/run.sh +++ b/photoprism/rootfs/run.sh @@ -66,7 +66,7 @@ if bashio::config.has_value 'localdisks'; then fi || true ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -92,10 +92,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname @@ -143,6 +151,7 @@ if bashio::config.has_value 'networkdisks'; then fi + ############## # LAUNCH APP # ############## diff --git a/plex/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/plex/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/plex/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/plex/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/prowlarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/prowlarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/prowlarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/prowlarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh b/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/qbittorrent/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/radarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/radarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/radarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/radarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/readarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/readarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/readarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/readarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/sonarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh b/sonarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/sonarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/sonarr/root/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/transmission/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh b/transmission/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/transmission/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/transmission/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname diff --git a/ubooquity/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh b/ubooquity/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh index 3fabe99e6..ba4eab4b8 100644 --- a/ubooquity/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh +++ b/ubooquity/rootfs/etc/cont-init.d/92-smb_mounts_v1.4.sh @@ -1,7 +1,7 @@ #!/usr/bin/with-contenv bashio ######################### -# MOUNT SMB SHARES v1.5 # +# MOUNT SMB SHARES v1.6 # ######################### if bashio::config.has_value 'networkdisks'; then @@ -27,10 +27,18 @@ if bashio::config.has_value 'networkdisks'; then # Mounting disks for disk in ${MOREDISKS//,/ }; do # Separate comma separated values + # Clean name of network share disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname=${disk//\\//} #replace \ with / 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 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 mkdir -p /mnt/$diskname chown -R root:root /mnt/$diskname