no version change, fine tuning

This commit is contained in:
inxi-svn 2009-03-02 00:45:56 +00:00
parent 71d17ace13
commit e019b33206

8
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.0.4-b1-t3 #### version: 1.0.4-b1-t4
#### Date: 1 March 2009 #### Date: 1 March 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -2408,12 +2408,16 @@ get_partition_data()
# though this can include /dev/ramzswap0. Note: you can also use /proc/swaps for this # though this can include /dev/ramzswap0. Note: you can also use /proc/swaps for this
# data, it's the same exact output as swapon -s # data, it's the same exact output as swapon -s
$( swapon -s | gawk ' $( swapon -s | gawk '
BEGIN {
swapCounter = 1
}
/^\/dev/ { /^\/dev/ {
size = sprintf( "%.2f", $3*1024/1000**3 ) size = sprintf( "%.2f", $3*1024/1000**3 )
devBase = gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 ) devBase = gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 )
used = sprintf( "%.2f", $4*1024/1000**3 ) used = sprintf( "%.2f", $4*1024/1000**3 )
percentUsed = sprintf( "%.0f", ( $4/$3 )*100 ) percentUsed = sprintf( "%.0f", ( $4/$3 )*100 )
print "swap," size "GB," used "GB," percentUsed "\%,main," devBase print "swap-" swapCounter "," size "GB," used "GB," percentUsed "\%,main," devBase
swapCounter = ++swapCounter
}' ) ) }' ) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"