From 09014c9b032fda3971dbbabc45f5d2bc90b48718 Mon Sep 17 00:00:00 2001 From: Douglas Makey Mendez Molero Date: Wed, 8 May 2024 23:05:33 -0400 Subject: [PATCH] feat: grab disk devices with size greather than 0 and order them by size. --- discovery/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery/entrypoint.sh b/discovery/entrypoint.sh index 1a1e4f6..0d15855 100755 --- a/discovery/entrypoint.sh +++ b/discovery/entrypoint.sh @@ -32,7 +32,7 @@ get_mem_info() { # Function to get physical disk info get_disk_info() { - disk_info=$(lsblk -dpno NAME | awk '{printf "\"%s\",", $1}' | sed 's/,$//') + disk_info=$(lsblk -dpno NAME,SIZE | awk '$2 != "0B" {print $1, $2}' | sort -k2 -rh | awk '{printf "\"%s\",", $1}' | sed 's/,$//') echo "[${disk_info}]" }