From c19d5b8b235c652c4e97e4a174718151e858e8b2 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 29 Nov 2020 18:15:35 +0100 Subject: [PATCH] local mounts --- emby/root/config/custom-cont-init.d/mount | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 emby/root/config/custom-cont-init.d/mount diff --git a/emby/root/config/custom-cont-init.d/mount b/emby/root/config/custom-cont-init.d/mount new file mode 100644 index 000000000..778aee9a3 --- /dev/null +++ b/emby/root/config/custom-cont-init.d/mount @@ -0,0 +1,31 @@ +#!/usr/bin/with-contenv bashio +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 + do + bashio::log.info "Mount ${disk}" + mount $disk /share/$disk && \ + bashio::log.info "Success!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount local drives!" +fi + +# Mount CIFS Share if configured and if Protection Mode is active +if bashio::config.has_value 'networkdisks'; then + MOREDISKS=$(bashio::config 'networkdisks') + CIFS_USERNAME=$(bashio::config 'cifsusername') + CIFS_PASSWORD=$(bashio::config 'cifspassword') + bashio::log.info "Network Disks mounting.. ${MOREDISKS}" && \ + for disk in $MOREDISKS + do + bashio::log.info "Mount ${disk}" + mkdir -p /$disk && \ + mount -t cifs -o username=$CIFS_USERNAME,password=$CIFS_PASSWORD $disk /$disk && \ + bashio::log.info "Success!" + done || \ + bashio::log.warning "Protection mode is ON. Unable to mount external drives!" +fi