update system info

This commit is contained in:
Teddysun 2016-08-07 18:51:04 +09:00
parent 773d97a62d
commit 4dde96253d

View File

@ -50,6 +50,7 @@ get_os_info(){
local tram=$( free -m | awk '/Mem/ {print $2}' ) local tram=$( free -m | awk '/Mem/ {print $2}' )
local swap=$( free -m | awk '/Swap/ {print $2}' ) local swap=$( free -m | awk '/Swap/ {print $2}' )
local up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime ) local up=$( awk '{a=$1/86400;b=($1%86400)/3600;c=($1%3600)/60;d=$1%60} {printf("%ddays, %d:%d:%d\n",a,b,c,d)}' /proc/uptime )
local load=$( w | head -1 | awk -F'load average:' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//' )
local opsy=$( get_opsy ) local opsy=$( get_opsy )
local arch=$( uname -m ) local arch=$( uname -m )
local lbit=$( getconf LONG_BIT ) local lbit=$( getconf LONG_BIT )
@ -64,6 +65,7 @@ get_os_info(){
echo "Total amount of ram : ${tram} MB" echo "Total amount of ram : ${tram} MB"
echo "Total amount of swap : ${swap} MB" echo "Total amount of swap : ${swap} MB"
echo "System uptime : ${up}" echo "System uptime : ${up}"
echo "Load average : ${load}"
echo "OS : ${opsy}" echo "OS : ${opsy}"
echo "Arch : ${arch} (${lbit} Bit)" echo "Arch : ${arch} (${lbit} Bit)"
echo "Kernel : ${kern}" echo "Kernel : ${kern}"