From bce4e4bc1104155dd28602f932048b0cf02dbd9d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sat, 4 Mar 2023 09:54:03 +0100 Subject: [PATCH] List All Drives --- .templates/92-local_mounts.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.templates/92-local_mounts.sh b/.templates/92-local_mounts.sh index c6ff7498c..bcbd3c6a8 100755 --- a/.templates/92-local_mounts.sh +++ b/.templates/92-local_mounts.sh @@ -1,6 +1,24 @@ #!/usr/bin/with-contenv bashio # shellcheck shell=bash +#################### +# LIST LOCAL DISKS # +#################### + +bashio::log.info "List of available labels (@dianlight) + bashio::log.blue "---------------------------------------------------" + #autodisks=($(lsblk -E label -n -o label | sed -r '/^\s*$/d' | grep -v hassos | grep pp)) + readarray -t autodisks < <(lsblk -E label -n -o label -i | sed -r '/^\s*$/d' | grep -v hassos) + if [ ${#autodisks[@]} -eq 0 ]; then + bashio::log.info "No Disk with labels." + else + bashio::log.info "Available Disk Labels:" + for disk in ${autodisks[@]}; do + bashio::log.info "\t${disk}[$(lsblk $(blkid -L "$disk") -no fstype)]" + done + fi + bashio::log.blue "---------------------------------------------------" + ###################### # MOUNT LOCAL SHARES # ######################