From 942a349669be363578b3a140b4263554eb38f6fa Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 30 Sep 2023 07:09:43 +0200 Subject: [PATCH] Update 00-local_mounts.sh --- .templates/00-local_mounts.sh | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.templates/00-local_mounts.sh b/.templates/00-local_mounts.sh index 516f831a1..b1d80075a 100755 --- a/.templates/00-local_mounts.sh +++ b/.templates/00-local_mounts.sh @@ -1,26 +1,6 @@ #!/usr/bin/with-contenv bashio # shellcheck shell=bash -################# -# INSTALL TOOLS # -################# - -# Install lsblk -if ! command -v "lsblk" &>/dev/null; then - if command -v "apk" &>/dev/null; then apk add --no-cache lsblk >/dev/null; fi - if command -v "apt" &>/dev/null; then apt-get update && apt-get install -yqq util-linux; fi -fi - -#################### -# LIST LOCAL DISKS # -#################### - -## List available Disk with Labels and Id -bashio::log.blue "---------------------------------------------------" -bashio::log.info "Available Disks :" -lsblk -o name,label,size,fstype,type,ro | awk '$5 != "" { print $0 }' -bashio::log.blue "---------------------------------------------------" - ###################### # MOUNT LOCAL SHARES # ###################### @@ -28,6 +8,18 @@ bashio::log.blue "---------------------------------------------------" # Mount local Share if configured if bashio::config.has_value 'localdisks'; then + # Install lsblk + if ! command -v "lsblk" &>/dev/null; then + if command -v "apk" &>/dev/null; then apk add --no-cache lsblk >/dev/null; fi + if command -v "apt" &>/dev/null; then apt-get update && apt-get install -yqq util-linux; fi + fi + + ## List available Disk with Labels and Id + bashio::log.blue "---------------------------------------------------" + bashio::log.info "Available Disks :" + lsblk -o name,label,size,fstype,type,ro | awk '$5 != "" { print $0 }' + bashio::log.blue "---------------------------------------------------" + MOREDISKS=$(bashio::config 'localdisks') echo "Local Disks mounting..."