mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
24 lines
664 B
Bash
24 lines
664 B
Bash
#!/usr/bin/with-contenv bashio
|
|
|
|
######################
|
|
# MOUNT LOCAL SHARES #
|
|
######################
|
|
|
|
|
|
|
|
# Mount local Share if configured
|
|
if bashio::config.has_value 'localdisks'; then
|
|
|
|
MOREDISKS=$(bashio::config 'localdisks')
|
|
echo "Local Disks mounting..."
|
|
|
|
# Separate comma separated values
|
|
for disk in ${MOREDISKS//,/ }; do
|
|
# Mount each disk
|
|
mkdir -p /mnt/$disk
|
|
chown -R $(id -u):$(id -g) /mnt/$disk
|
|
[ -d /share/$disk ] && mount /dev/$disk /share/$disk || true
|
|
mount /dev/$disk /mnt/$disk && bashio::log.info "Success! $disk mounted to /mnt/$disk" || (bashio::log.fatal "Unable to mount local drives!" && rmdir /mnt/$disk)
|
|
done
|
|
fi
|