mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
no version change, fine tuning
This commit is contained in:
parent
71d17ace13
commit
e019b33206
8
inxi
8
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.0.4-b1-t3
|
||||
#### version: 1.0.4-b1-t4
|
||||
#### Date: 1 March 2009
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
|
@ -2408,12 +2408,16 @@ get_partition_data()
|
|||
# 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
|
||||
$( swapon -s | gawk '
|
||||
BEGIN {
|
||||
swapCounter = 1
|
||||
}
|
||||
/^\/dev/ {
|
||||
size = sprintf( "%.2f", $3*1024/1000**3 )
|
||||
devBase = gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 )
|
||||
used = sprintf( "%.2f", $4*1024/1000**3 )
|
||||
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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue