Skip to content

Commit

Permalink
Update 00-local_mounts.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbelgium authored Sep 30, 2023
1 parent 2ba2631 commit e64e459
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .templates/00-local_mounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ if bashio::config.has_value 'localdisks'; then
bashio::log.blue "---------------------------------------------------"

# Show support fs https://github.com/dianlight/hassio-addons/blob/2e903184254617ac2484fe7c03a6e33e6987151c/sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/run#L106
fstypes=$(grep -v nodev </proc/filesystems | awk '{$1=" "$1}1' | tr -d '\n\t')
bashio::log.green "Supported fs : ${fstypes}"
fstypessupport=$(grep -v nodev </proc/filesystems | awk '{$1=" "$1}1' | tr -d '\n\t')
bashio::log.green "Supported fs : ${fstypessupport}"
bashio::log.green "Inspired from : github.com/dianlight"
bashio::log.blue "---------------------------------------------------"

Expand Down Expand Up @@ -50,8 +50,15 @@ if bashio::config.has_value 'localdisks'; then
fstype=$(lsblk "$devpath"/"$disk" -no fstype)
options="nosuid,relatime,noexec"
type="auto"
bashio::log.info "Mounting ${disk} of type ${fstype}"

# Check if supported
if [[ *"${fstype}"* != "$fstypessupport" ]]; then
bashio::log.fatal : "${fstype} type for ${disk} is not supported"
break
fi

# Mount drive
bashio::log.info "Mounting ${disk} of type ${fstype}"
case "$fstype" in
exfat | vfat | msdos)
bashio::log.warning "${fstype} permissions and ACL don't works and this is an EXPERIMENTAL support"
Expand Down

0 comments on commit e64e459

Please sign in to comment.