mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 18:31:02 +01:00
List All Drives
This commit is contained in:
@@ -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 #
|
||||
######################
|
||||
|
||||
Reference in New Issue
Block a user