mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
added swpctl -l for bsd in -D, though -D doesn't work yet for bsds, but might as well.
This commit is contained in:
parent
fe09e772f6
commit
41087ac9a3
33
inxi
33
inxi
|
@ -5424,15 +5424,6 @@ get_hdd_data_basic()
|
||||||
df_string="df -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs
|
df_string="df -P -T --exclude-type=aufs --exclude-type=devfs --exclude-type=devtmpfs
|
||||||
--exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs
|
--exclude-type=fdescfs --exclude-type=iso9660 --exclude-type=linprocfs --exclude-type=procfs
|
||||||
--exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs $df_total"
|
--exclude-type=squashfs --exclude-type=sysfs --exclude-type=tmpfs --exclude-type=unionfs $df_total"
|
||||||
else
|
|
||||||
# default size is 512, , so use -k for 1024 -H only for size in human readable format
|
|
||||||
# older bsds don't support -T, pain, so we'll use partial output there
|
|
||||||
if df -k -T &>/dev/null;then
|
|
||||||
df_string='df -k -T'
|
|
||||||
else
|
|
||||||
df_string='df -k'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if swapon -s &>/dev/null;then
|
if swapon -s &>/dev/null;then
|
||||||
swap_size=$( swapon -s 2>/dev/null | gawk '
|
swap_size=$( swapon -s 2>/dev/null | gawk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
@ -5449,6 +5440,30 @@ get_hdd_data_basic()
|
||||||
print total
|
print total
|
||||||
}' )
|
}' )
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# default size is 512, , so use -k for 1024 -H only for size in human readable format
|
||||||
|
# older bsds don't support -T, pain, so we'll use partial output there
|
||||||
|
if df -k -T &>/dev/null;then
|
||||||
|
df_string='df -k -T'
|
||||||
|
else
|
||||||
|
df_string='df -k'
|
||||||
|
fi
|
||||||
|
if swapctl -l &>/dev/null;then
|
||||||
|
swap_size=$( swapctl -l 2>/dev/null | gawk '
|
||||||
|
BEGIN {
|
||||||
|
swapSize=0
|
||||||
|
total=0
|
||||||
|
}
|
||||||
|
( $1 ~ /^\/dev/ ) && ( $2 ~ /^[0-9]+$/ ) {
|
||||||
|
total += $2
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
# result in blocks already
|
||||||
|
print total
|
||||||
|
}' )
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# echo ss: $swap_size
|
# echo ss: $swap_size
|
||||||
hdd_data="$( eval $df_string )"
|
hdd_data="$( eval $df_string )"
|
||||||
# eval $df_string | awk 'BEGIN{tot=0} !/total/ {tot+=$4} END{print tot}'
|
# eval $df_string | awk 'BEGIN{tot=0} !/total/ {tot+=$4} END{print tot}'
|
||||||
|
|
Loading…
Reference in a new issue