From 5e006800da28f78b4eb3f03e3c92781d7283990b Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 30 Oct 2021 22:45:49 +0200 Subject: [PATCH] 92-local_mounts.sh --- .../rootfs/etc/cont-init.d/92-local_mounts.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 transmission/rootfs/etc/cont-init.d/92-local_mounts.sh diff --git a/transmission/rootfs/etc/cont-init.d/92-local_mounts.sh b/transmission/rootfs/etc/cont-init.d/92-local_mounts.sh new file mode 100644 index 000000000..d9dea1eeb --- /dev/null +++ b/transmission/rootfs/etc/cont-init.d/92-local_mounts.sh @@ -0,0 +1,23 @@ +#!/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