From 9aa832e81b3a9a4922edeba6ffb1c06163714eed Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 17 Feb 2022 19:38:04 +0100 Subject: [PATCH] Update 92-smb_mounts.sh --- .templates/92-smb_mounts.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.templates/92-smb_mounts.sh b/.templates/92-smb_mounts.sh index aa9188f95..739685a52 100644 --- a/.templates/92-smb_mounts.sh +++ b/.templates/92-smb_mounts.sh @@ -29,7 +29,7 @@ if bashio::config.has_value 'networkdisks'; then for disk in ${MOREDISKS//,/ }; do # Separate comma separated values # Clean name of network share - # shellcheck disable=SC2116 + # shellcheck disable=SC2116,SC2001 disk=$(echo $disk | sed "s,/$,,") # Remove / at end of name diskname="${disk//\\//}" #replace \ with / diskname="${diskname##*/}" # Get only last part of the name @@ -44,7 +44,8 @@ if bashio::config.has_value 'networkdisks'; then mkdir -p /mnt/"$diskname" chown -R root:root /mnt/"$diskname" - #Tries to mount with default options + # Tries to mount with default options + # shellcheck disable=SC2140 mount -t cifs -o rw,username="$CIFS_USERNAME",password="${CIFS_PASSWORD}$DOMAIN" "$disk" /mnt/"$diskname" 2>ERRORCODE && MOUNTED=true || MOUNTED=false # if Fail test different smb and sec versions @@ -58,8 +59,9 @@ if bashio::config.has_value 'networkdisks'; then fi # Messages - if [ "$MOUNTED" = true ] && [ "mountpoint -q /mnt/$diskname" ]; then + if [ "$MOUNTED" = true ] && [ mountpoint -q /mnt/"$diskname" ]; then #Test write permissions + # shellcheck disable=SC2015 touch "/mnt/$diskname/testaze" && rm "/mnt/$diskname/testaze" && bashio::log.info "... $disk successfully mounted to /mnt/$diskname with options $SMBVERS$SECVERS" || bashio::log.fatal "Disk is mounted, however unable to write in the shared disk. Please check UID/GID for permissions, and if the share is rw"