From d286bad902466816ca02f6db9c8a3d57cdab2759 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:19:47 +0200 Subject: [PATCH] Update 00-local_mounts.sh --- .templates/00-local_mounts.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.templates/00-local_mounts.sh b/.templates/00-local_mounts.sh index 1d3c09449..3ec3eccea 100755 --- a/.templates/00-local_mounts.sh +++ b/.templates/00-local_mounts.sh @@ -1,6 +1,16 @@ #!/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 # #################### @@ -54,12 +64,6 @@ if bashio::config.has_value 'localdisks'; then chown "$PUID:$PGID" /mnt/"$disk" fi - # 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 - # Check FS type and set relative options (thanks @https://github.com/dianlight/hassio-addons) fstype=$(lsblk "$devpath"/"$disk" -no fstype) options="nosuid,relatime,noexec"