https://bugzilla.novell.com/show_bug.cgi?id=404648 User jrecord@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=404648#c2 Jason Record <jrecord@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #2 from Jason Record <jrecord@novell.com> 2008-07-09 12:56:08 MDT --- Fix checked in. Index: scripts/hostinfo =================================================================== --- scripts/hostinfo (revision 29) +++ scripts/hostinfo (revision 30) @@ -1,5 +1,5 @@ #!/bin/bash -SVER=0.51-2 +SVER=0.51-4 ############################################################################## # hostinfo - Displays brief system information # @@ -23,6 +23,7 @@ # ############################################################################## +OPT_DISPLAY_DISK_FREE=1 PAD=20 DEFAULT_DELAY=30 DELAY=0 @@ -96,12 +97,26 @@ } printdisks() { - DISK_SIZES=$(egrep '[s,h,xv,c][0-9]?d[a-z,0-9]$' /proc/partitions | awk '{printf "%s %.1f %s\n", "/dev/"$4, $3*1024/1000^3, "GB"}') + DISK_SIZES=$(egrep '[s,h,xv,c][0-9]?d[a-z,0-9]$' /proc/partitions | awk '{printf "%s %u %s\n", "/dev/"$4, $3*1024/1000^3, "GB"}') if [ -z "$DISK_SIZES" ]; then DISK_SIZES=Unknown fi - echo "$DISK_SIZES" | while read THIS_DISK + echo "$DISK_SIZES" | while read DISK_INFO do + DEV_CHECK=$(echo $DISK_INFO | awk '{print $1}') + DISK_FREE=0 + if (( OPT_DISPLAY_DISK_FREE )); then + for DISK_ADD in $(df | grep ^${DEV_CHECK} | awk '{print $4}') + do + DISK_FREE=$(( DISK_FREE + DISK_ADD )) + done + fi + if (( DISK_FREE )); then + DISK_INFO="$DISK_INFO $DISK_FREE" + THIS_DISK=$(echo $DISK_INFO | awk '{printf "%s %u/%u %s\n", $1, $2, $4*1024/1000^3, $3}') + else + THIS_DISK=$DISK_INFO + fi printf "$ROW_OUT" "Hard Disk:" "$THIS_DISK" done } @@ -132,7 +147,7 @@ get_vt_vars ALL_ARGS="$@" -while getopts :wtT: TMPOPT +while getopts :wtT:f TMPOPT do case $TMPOPT in \:) case $OPTARG in @@ -150,6 +165,7 @@ w) get_html_vars ;; T) DELAY=$OPTARG ;; t) DELAY=$DEFAULT_DELAY ;; + f) OPT_DISPLAY_DISK_FREE=0 ;; esac done -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.