mirror of
https://github.com/masonr/yet-another-bench-script.git
synced 2026-07-04 15:48:22 +00:00
fix for bad uptime calculation (#92)
This commit is contained in:
2
yabs.sh
2
yabs.sh
@@ -235,7 +235,7 @@ function format_size {
|
|||||||
echo -e
|
echo -e
|
||||||
echo -e "Basic System Information:"
|
echo -e "Basic System Information:"
|
||||||
echo -e "---------------------------------"
|
echo -e "---------------------------------"
|
||||||
UPTIME=$(uptime | awk -F'( |,|:)+' '{d=h=m=0; if ($7=="min") m=$6; else {if ($7~/^day/) {d=$6;h=$8;m=$9} else {h=$6;m=$7}}} {print d+0,"days,",h+0,"hours,",m+0,"minutes"}')
|
UPTIME=$(uptime | awk -F'( |,|:)+' '{d=h=m=0; if ($7=="min") m=$6; else {if ($7~/^day/) {d=$6; if ($9~/^min/) m=$8; else {h=$8;m=$9}} else {h=$6;m=$7}}} {print d+0,"days,",h+0,"hours,",m+0,"minutes"}')
|
||||||
echo -e "Uptime : $UPTIME"
|
echo -e "Uptime : $UPTIME"
|
||||||
# check for local lscpu installs
|
# check for local lscpu installs
|
||||||
if command -v lscpu >/dev/null 2>&1; then
|
if command -v lscpu >/dev/null 2>&1; then
|
||||||
|
|||||||
Reference in New Issue
Block a user