mirror of
https://gitlab.com/mattia.basaglia/ASCII-Pony.git
synced 2024-11-21 19:57:59 +01:00
Improve CPU_Usage formatting
This commit is contained in:
parent
e10ea10782
commit
1434ccf47a
2 changed files with 2 additions and 1 deletions
1
README
1
README
|
@ -43,6 +43,7 @@ Config Variables:
|
|||
Requirements:
|
||||
* lsb-release for Distro
|
||||
* lxc for Containers
|
||||
* bc for CPU_Usage
|
||||
|
||||
Generating Images
|
||||
-----------------
|
||||
|
|
|
@ -83,7 +83,7 @@ function ponyget_CPU()
|
|||
|
||||
function ponyget_CPU_Usage()
|
||||
{
|
||||
echo "$(top -b -n1 | grep "Cpu(s):" | sed -r -e "s/^[^0-9]+//" -e "s/[^0-9]+,\s+/ + /g" -e "s/[^0-9]+$//" | cut -d ' ' -f 1-5 | bc)%"
|
||||
printf %.1f%% "$(top -b -n1 | grep "Cpu(s):" | sed -r -e "s/^[^0-9]+//" -e "s/[^0-9]+,\s+/ + /g" -e "s/[^0-9]+$//" | cut -d ' ' -f 1-5 | bc)"
|
||||
}
|
||||
|
||||
function ponyget_Uptime()
|
||||
|
|
Loading…
Reference in a new issue