From 8155f83c14d7ef260cca630776a89c062380d625 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 1 Oct 2021 22:09:32 +0200 Subject: [PATCH] Create 92-local_mounts_v1.2.sh --- .../etc/cont-init.d/92-local_mounts_v1.2.sh | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 qbittorrent/rootfs/etc/cont-init.d/92-local_mounts_v1.2.sh diff --git a/qbittorrent/rootfs/etc/cont-init.d/92-local_mounts_v1.2.sh b/qbittorrent/rootfs/etc/cont-init.d/92-local_mounts_v1.2.sh new file mode 100644 index 000000000..cd9fff57e --- /dev/null +++ b/qbittorrent/rootfs/etc/cont-init.d/92-local_mounts_v1.2.sh @@ -0,0 +1,26 @@ +#!/usr/bin/with-contenv bashio + +###################### +# MOUNT LOCAL SHARES # +###################### + +bashio::log.info 'Mounting external hdd...' + +# Mount local Share if configured and if Protection Mode is active +if bashio::config.has_value 'localdisks'; then + MOREDISKS=$(bashio::config 'localdisks') + bashio::log.info "Local Disks mounting.. ${MOREDISKS}" && \ + for disk in ${MOREDISKS//,/ } # Separate comma separated values + do + bashio::log.info "Mount ${disk}" + mkdir -p /mnt/$disk && \ + if [ ! -d /mnt/$disk ]; then + echo "Creating /mnt/$disk" + mkdir -p /mnt/$disk + chown -R abc:abc /mnt/$disk + fi + mount /dev/$disk /mnt/$disk && \ + bashio::log.info "Success! Mounted to /mnt/$disk" + done || \ + bashio::log.warning "Unable to mount local drives!" +fi