diff --git a/bench.sh b/bench.sh index ca70a1e..40c0c27 100644 --- a/bench.sh +++ b/bench.sh @@ -191,10 +191,18 @@ uram=$( free -m | awk '/Mem/ {print $3}' ) swap=$( free -m | awk '/Swap/ {print $2}' ) uswap=$( free -m | awk '/Swap/ {print $3}' ) up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60} {printf("%d days, %d hour %d min\n",a,b,c)}' /proc/uptime ) -load=$( w | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) +if _exists "w"; then + load=$( w | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) +elif _exists "uptime"; then + load=$( uptime | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' ) +fi opsy=$( get_opsy ) arch=$( uname -m ) -lbit=$( getconf LONG_BIT ) +if _exists "getconf"; then + lbit=$( getconf LONG_BIT ) +else + echo ${arch} | grep -q "64" && lbit="64" || lbit="32" +fi kern=$( uname -r ) disk_size1=($( LANG=C df -hPl | grep -wvE '\-|none|tmpfs|devtmpfs|by-uuid|chroot|Filesystem|udev|docker' | awk '{print $2}' )) disk_size2=($( LANG=C df -hPl | grep -wvE '\-|none|tmpfs|devtmpfs|by-uuid|chroot|Filesystem|udev|docker' | awk '{print $3}' ))