mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-04 14:54:07 +02:00
Update 92-local_mounts.sh
This commit is contained in:
@@ -37,17 +37,17 @@ if bashio::config.has_value 'localdisks'; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check FS type and set relative options (thanks @https://github.com/dianlight/hassio-addons)
|
# 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"
|
options="nosuid,relatime,noexec"
|
||||||
type="auto"
|
type="auto"
|
||||||
|
|
||||||
case "$fstype" in
|
case "$fstype" in
|
||||||
exfat | vfat | msdos)
|
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"
|
options="${options},umask=000"
|
||||||
;;
|
;;
|
||||||
ntfs)
|
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"
|
options="${options},umask=000"
|
||||||
type="ntfs3"
|
type="ntfs3"
|
||||||
;;
|
;;
|
||||||
@@ -62,8 +62,9 @@ if bashio::config.has_value 'localdisks'; then
|
|||||||
|
|
||||||
# Legacy mounting : mount to share if still exists (avoid breaking changes)
|
# Legacy mounting : mount to share if still exists (avoid breaking changes)
|
||||||
dirpath="/mnt"
|
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" || \
|
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)
|
(bashio::log.fatal "Unable to mount local drives! Please check the name." && rmdir /mnt/$disk)
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user