From 4a27053fd15028dbba260628ed96bd3b2145a5c1 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 15 Feb 2023 10:18:37 +0100 Subject: [PATCH] Update 92-local_mounts.sh --- .templates/92-local_mounts.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.templates/92-local_mounts.sh b/.templates/92-local_mounts.sh index 6056202a1..e6e187aa9 100755 --- a/.templates/92-local_mounts.sh +++ b/.templates/92-local_mounts.sh @@ -37,17 +37,17 @@ if bashio::config.has_value 'localdisks'; then fi # Check FS type and set relative options (thanks @https://github.com/dianlight/hassio-addons) - fstype=$(lsblk $dev -no fstype) + fstype=$(lsblk "$devpath"/"$disk" -no fstype) options="nosuid,relatime,noexec" type="auto" case "$fstype" in exfat | vfat | msdos) - bashio::log.warning "Your ${mdisk} is ${fstype}. Permissions and ACL don't works and this is an EXPERIMENTAL support" + bashio::log.warning "${disk} is ${fstype}. Permissions and ACL don't works and this is an EXPERIMENTAL support" options="${options},umask=000" ;; ntfs) - bashio::log.warning "Your ${mdisk} is ${fstype}. This is an EXPERIMENTAL support" + bashio::log.warning "${disk} is ${fstype}. This is an EXPERIMENTAL support" options="${options},umask=000" type="ntfs3" ;; @@ -62,8 +62,9 @@ if bashio::config.has_value 'localdisks'; then # Legacy mounting : mount to share if still exists (avoid breaking changes) dirpath="/mnt" - if [ -d /share/"$disk" ]; then dirpath ="/share"; fi + if [ -d /share/"$disk" ]; then dirpath="/share"; fi + # shellcheck disable=SC2015 mount -t $type "$devpath"/"$disk" "$dirpath"/"$disk" -o $options && bashio::log.info "Success! $disk mounted to /mnt/$disk" || \ (bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk) done