From 009e578a676f449e554f1c59c148ba33ca11dc51 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 12 Dec 2019 23:34:58 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index ca716dad..11e7a80a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -378,9 +378,13 @@ STATUS(){ echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_NODETYPES[$NTYPE]}-Node${nid} (${nip})${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYello]}${LH}${idsCL[Default]}" DIVIDER false green fi - - freespace=`${NCMD} df -hBM | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output | awk '{ print $2 }'; done` - echo ${freespace[*]} + declare -A partitions + partitions=`${NCMD} df -hBM | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output | awk '{ print $2 }'; done` + for partition in "${partitions[@]}"; do + freespace=`${NCMD} df -hPBM ${partition} | awk '{print $5}' |tail -1|sed 's/%$//g'` + echo -en " ${partition}$spc: " + echo -e "${idsCL[Green]}${freespace}${idsCL[Default]}" + done # ${NCMD} df -hBM | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do