﻿{"id":311,"date":"2020-07-08T06:07:11","date_gmt":"2020-07-07T22:07:11","guid":{"rendered":"https:\/\/byy3.com\/?p=311"},"modified":"2021-01-09T10:14:23","modified_gmt":"2021-01-09T02:14:23","slug":"%e4%ba%91%e4%b8%bb%e6%9c%ba%e6%b5%8b%e8%af%95%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=311","title":{"rendered":"\u4e91\u4e3b\u673a\u6d4b\u8bd5\u811a\u672c"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6d4b\u8bd5\u4e3b\u673a\u547d\u4ee4#wget -qO- git.io\/superbench.sh | bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;span class=\"hljs-header\">Usage : wget -qO- git.io\/superbench.sh | bash\n----------------------------------------------------------------------&lt;\/span>\n&lt;span class=\"hljs-code\"> CPU Model : Intel Core Processor (Broadwell)&lt;\/span>\n&lt;span class=\"hljs-code\"> CPU Cores : 1 Cores @ 2194.916 MHz x86_64&lt;\/span>\n&lt;span class=\"hljs-code\"> CPU Cache : 4096 KB&lt;\/span>\n&lt;span class=\"hljs-code\"> OS : CentOS 7.2.1511 (64 Bit) KVM&lt;\/span>\n&lt;span class=\"hljs-code\"> Kernel : 3.10.0-957.1.3.el7.x86_64&lt;\/span>\n&lt;span class=\"hljs-code\"> Total Space : 3.1 GB \/ 20.0 GB&lt;\/span>\n&lt;span class=\"hljs-code\"> Total RAM : 390 MB \/ 927 MB (67 MB Buff)&lt;\/span>\n&lt;span class=\"hljs-code\"> Total SWAP : 203 MB \/ 511 MB&lt;\/span>\n&lt;span class=\"hljs-code\"> Uptime : 0 days 1 hour 7 min&lt;\/span>\n&lt;span class=\"hljs-code\"> Load Average : 0.00, 0.05, 0.44&lt;\/span>\n&lt;span class=\"hljs-code\"> TCP CC : cubic&lt;\/span>\n&lt;span class=\"hljs-code\"> ASN &amp; ISP : AS23724, UCLOUD&lt;\/span>\n&lt;span class=\"hljs-code\"> Organization : Shanghai UCloud Information Technology Company Limited&lt;\/span>\n&lt;span class=\"hljs-code\"> Location : Beijing, China \/ CN&lt;\/span>\n&lt;span class=\"hljs-header\"> Region : Beijing\n----------------------------------------------------------------------&lt;\/span>\n&lt;span class=\"hljs-code\"> I\/O Speed( 1.0GB ) : 94.3 MB\/s&lt;\/span>\n&lt;span class=\"hljs-code\"> I\/O Speed( 1.0GB ) : 94.4 MB\/s&lt;\/span>\n&lt;span class=\"hljs-code\"> I\/O Speed( 1.0GB ) : 94.5 MB\/s&lt;\/span>\n&lt;span class=\"hljs-header\"> Average I\/O Speed : 94.4 MB\/s\n----------------------------------------------------------------------&lt;\/span>\n&lt;span class=\"hljs-code\"> Node Name Upload Speed Download Speed Latency&lt;\/span>\n&lt;span class=\"hljs-code\"> Speedtest.net 1.45 Mbit\/s 51.59 Mbit\/s 41.231 ms&lt;\/span>\n&lt;span class=\"hljs-code\"> Fast.com 0.00 Mbit\/s 38.0 Mbit\/s -&lt;\/span>\n&lt;span class=\"hljs-code\"> Guangzhou CT 1.44 Mbit\/s 48.30 Mbit\/s -&lt;\/span>\n&lt;span class=\"hljs-code\"> Wuhan CT 1.06 Mbit\/s 50.50 Mbit\/s -&lt;\/span>\n&lt;span class=\"hljs-code\"> Hangzhou CT 1.43 Mbit\/s 51.85 Mbit\/s -&lt;\/span>\n&lt;span class=\"hljs-code\"> Shanghai CU 1.27 Mbit\/s 52.44 Mbit\/s -&lt;\/span>\n&lt;span class=\"hljs-code\"> Heifei CU 1.37 Mbit\/s 44.16 Mbit\/s -&lt;\/span>\n&lt;span class=\"hljs-header\"> Chongqing CU 1.35 Mbit\/s 51.25 Mbit\/s -\n----------------------------------------------------------------------&lt;\/span>\n&lt;span class=\"hljs-code\"> Finished in : 10 min 0 sec&lt;\/span>\n&lt;span class=\"hljs-code\"> Timestamp : 2019-09-01 13:27:00 GMT+8&lt;\/span>\n&lt;span class=\"hljs-code\"> Results : \/root\/superbench.log&lt;\/span><\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/ufile.lifeng.in\/uploads\/2019\/09\/add2fc815ba4d57.png\" data-fancybox=\"gallery\" rel=\"nofollow\" ><img decoding=\"async\" data-original=\"https:\/\/ufile.lifeng.in\/uploads\/2019\/09\/add2fc815ba4d57.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" class=\"wp-image-1412\" title=\"\u4e91\u4e3b\u673a\u6d4b\u8bd5\u811a\u672c\u63d2\u56fe\" alt=\"\u4e91\u4e3b\u673a\u6d4b\u8bd5\u811a\u672c\u63d2\u56fe\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6e90\u7801 superbench.sh<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env bash\n#\n# Description: Auto system info &amp; I\/O test &amp; network to China script\n#\n# Copyright (C) 2017 - 2020 Oldking &lt;oooldking@gmail.com>\n#\n# Thanks: Bench.sh &lt;i@teddysun.com>\n#\n# URL: https:\/\/www.oldking.net\/350.html\n#\n\nRED='\\033&#91;0;31m'\nGREEN='\\033&#91;0;32m'\nYELLOW='\\033&#91;0;33m'\nSKYBLUE='\\033&#91;0;36m'\nPLAIN='\\033&#91;0m'\n\nabout() {\n\techo \"\"\n\techo \" ========================================================= \"\n\techo \" \\ Superbench.sh Script \/ \"\n\techo \" \\ Basic system info, I\/O test and speedtest \/ \"\n\techo \" \\ v1.1.7 (7 Apr 2020) \/ \"\n\techo \" \\ Created by Oldking \/ \"\n\techo \" ========================================================= \"\n\techo \"\"\n\techo \" Intro: https:\/\/www.oldking.net\/350.html\"\n\techo \" Copyright (C) 2020 Oldking oooldking@gmail.com\"\n\techo \"\"\n}\n\ncancel() {\n\techo \"\"\n\tnext;\n\techo \" Abort ...\"\n\techo \" Cleanup ...\"\n\tcleanup;\n\techo \" Done\"\n\texit\n}\n\ntrap cancel SIGINT\n\nbenchinit() {\n\tif &#91; -f \/etc\/redhat-release ]; then\n\t release=\"centos\"\n\telif cat \/etc\/issue | grep -Eqi \"debian\"; then\n\t release=\"debian\"\n\telif cat \/etc\/issue | grep -Eqi \"ubuntu\"; then\n\t release=\"ubuntu\"\n\telif cat \/etc\/issue | grep -Eqi \"centos|red hat|redhat\"; then\n\t release=\"centos\"\n\telif cat \/proc\/version | grep -Eqi \"debian\"; then\n\t release=\"debian\"\n\telif cat \/proc\/version | grep -Eqi \"ubuntu\"; then\n\t release=\"ubuntu\"\n\telif cat \/proc\/version | grep -Eqi \"centos|red hat|redhat\"; then\n\t release=\"centos\"\n\tfi\n\n\t&#91;&#91; $EUID -ne 0 ]] &amp;&amp; echo -e \"${RED}Error:${PLAIN} This script must be run as root!\" &amp;&amp; exit 1\n\n\tif &#91; ! -e '\/usr\/bin\/python' ]; then\n\t echo \" Installing Python ...\"\n\t if &#91; \"${release}\" == \"centos\" ]; then\n\t \t\tyum update > \/dev\/null 2>&amp;1\n\t yum -y install python > \/dev\/null 2>&amp;1\n\t else\n\t \tapt-get update > \/dev\/null 2>&amp;1\n\t apt-get -y install python > \/dev\/null 2>&amp;1\n\t fi\n\t \n\tfi\n\n\tif &#91; ! -e '\/usr\/bin\/curl' ]; then\n\t echo \" Installing Curl ...\"\n\t if &#91; \"${release}\" == \"centos\" ]; then\n\t yum update > \/dev\/null 2>&amp;1\n\t yum -y install curl > \/dev\/null 2>&amp;1\n\t else\n\t apt-get update > \/dev\/null 2>&amp;1\n\t apt-get -y install curl > \/dev\/null 2>&amp;1\n\t fi\n\tfi\n\n\tif &#91; ! -e '\/usr\/bin\/wget' ]; then\n\t echo \" Installing Wget ...\"\n\t if &#91; \"${release}\" == \"centos\" ]; then\n\t yum update > \/dev\/null 2>&amp;1\n\t yum -y install wget > \/dev\/null 2>&amp;1\n\t else\n\t apt-get update > \/dev\/null 2>&amp;1\n\t apt-get -y install wget > \/dev\/null 2>&amp;1\n\t fi\n\tfi\n\n\tif &#91; ! -e '.\/speedtest-cli\/speedtest' ]; then\n\t\techo \" Installing Speedtest-cli ...\"\n\t\twget --no-check-certificate -qO speedtest.tgz https:\/\/cdn.jsdelivr.net\/gh\/oooldking\/script@1.1.7\/speedtest_cli\/ookla-speedtest-1.0.0-$(uname -m)-linux.tgz > \/dev\/null 2>&amp;1\n\tfi\n\tmkdir -p speedtest-cli &amp;&amp; tar zxvf speedtest.tgz -C .\/speedtest-cli\/ > \/dev\/null 2>&amp;1 &amp;&amp; chmod a+rx .\/speedtest-cli\/speedtest\n\n\tif &#91; ! -e 'tools.py' ]; then\n\t\techo \" Installing tools.py ...\"\n\t\twget --no-check-certificate https:\/\/cdn.jsdelivr.net\/gh\/oooldking\/script@1.1.7\/tools.py > \/dev\/null 2>&amp;1\n\tfi\n\tchmod a+rx tools.py\n\n\tif &#91; ! -e 'fast_com.py' ]; then\n\t\techo \" Installing Fast.com-cli ...\"\n\t\twget --no-check-certificate https:\/\/cdn.jsdelivr.net\/gh\/sanderjo\/fast.com@master\/fast_com.py > \/dev\/null 2>&amp;1\n\t\twget --no-check-certificate https:\/\/cdn.jsdelivr.net\/gh\/sanderjo\/fast.com@master\/fast_com_example_usage.py > \/dev\/null 2>&amp;1\n\tfi\n\tchmod a+rx fast_com.py\n\tchmod a+rx fast_com_example_usage.py\n\n\tsleep 5\n\n\tstart=$(date +%s) \n}\n\nget_opsy() {\n &#91; -f \/etc\/redhat-release ] &amp;&amp; awk '{print ($1,$3~\/^&#91;0-9]\/?$3:$4)}' \/etc\/redhat-release &amp;&amp; return\n &#91; -f \/etc\/os-release ] &amp;&amp; awk -F'&#91;= \"]' '\/PRETTY_NAME\/{print $3,$4,$5}' \/etc\/os-release &amp;&amp; return\n &#91; -f \/etc\/lsb-release ] &amp;&amp; awk -F'&#91;=\"]+' '\/DESCRIPTION\/{print $2}' \/etc\/lsb-release &amp;&amp; return\n}\n\nnext() {\n printf \"%-70s\\n\" \"-\" | sed 's\/\\s\/-\/g' | tee -a $log\n}\n\nspeed_test(){\n\tif &#91;&#91; $1 == '' ]]; then\n\t\tspeedtest-cli\/speedtest -p no --accept-license > $speedLog 2>&amp;1\n\t\tis_upload=$(cat $speedLog | grep 'Upload')\n\t\tresult_speed=$(cat $speedLog | awk -F ' ' '\/Result\/{print $3}')\n\t\tif &#91;&#91; ${is_upload} ]]; then\n\t local REDownload=$(cat $speedLog | awk -F ' ' '\/Download\/{print $3}')\n\t local reupload=$(cat $speedLog | awk -F ' ' '\/Upload\/{print $3}')\n\t local relatency=$(cat $speedLog | awk -F ' ' '\/Latency\/{print $2}')\n\n\t temp=$(echo \"$relatency\" | awk -F '.' '{print $1}')\n \tif &#91;&#91; ${temp} -gt 50 ]]; then\n \trelatency=\"(*)\"${relatency}\n \tfi\n\t local nodeName=$2\n\n\t temp=$(echo \"${REDownload}\" | awk -F ' ' '{print $1}')\n\t if &#91;&#91; $(awk -v num1=${temp} -v num2=0 'BEGIN{print(num1>num2)?\"1\":\"0\"}') -eq 1 ]]; then\n\t \tprintf \"${YELLOW}%-18s${GREEN}%-18s${RED}%-20s${SKYBLUE}%-12s${PLAIN}\\n\" \" ${nodeName}\" \"${reupload} Mbit\/s\" \"${REDownload} Mbit\/s\" \"${relatency} ms\" | tee -a $log\n\t fi\n\t\telse\n\t local cerror=\"ERROR\"\n\t\tfi\n\telse\n\t\tspeedtest-cli\/speedtest -p no -s $1 --accept-license > $speedLog 2>&amp;1\n\t\tis_upload=$(cat $speedLog | grep 'Upload')\n\t\tif &#91;&#91; ${is_upload} ]]; then\n\t local REDownload=$(cat $speedLog | awk -F ' ' '\/Download\/{print $3}')\n\t local reupload=$(cat $speedLog | awk -F ' ' '\/Upload\/{print $3}')\n\t local relatency=$(cat $speedLog | awk -F ' ' '\/Latency\/{print $2}')\n\t local nodeName=$2\n\n\t temp=$(echo \"${REDownload}\" | awk -F ' ' '{print $1}')\n\t if &#91;&#91; $(awk -v num1=${temp} -v num2=0 'BEGIN{print(num1>num2)?\"1\":\"0\"}') -eq 1 ]]; then\n\t \tprintf \"${YELLOW}%-18s${GREEN}%-18s${RED}%-20s${SKYBLUE}%-12s${PLAIN}\\n\" \" ${nodeName}\" \"${reupload} Mbit\/s\" \"${REDownload} Mbit\/s\" \"${relatency} ms\" | tee -a $log\n\t\t\tfi\n\t\telse\n\t local cerror=\"ERROR\"\n\t\tfi\n\tfi\n}\n\nprint_speedtest() {\n\tprintf \"%-18s%-18s%-20s%-12s\\n\" \" Node Name\" \"Upload Speed\" \"Download Speed\" \"Latency\" | tee -a $log\n speed_test '' 'Speedtest.net'\n speed_fast_com\n speed_test '27377' 'Beijing 5G CT'\n speed_test '26352' 'Nanjing 5G CT'\n speed_test '17145' 'Hefei 5G CT'\n\tspeed_test '27594' 'Guangzhou 5G CT'\n\tspeed_test '27154' 'TianJin 5G CU'\n\tspeed_test '24447' 'Shanghai 5G CU'\n\tspeed_test '26678' 'Guangzhou 5G CU'\n\tspeed_test '17184' 'Tianjin 5G CM'\n\tspeed_test '26850' 'Wuxi 5G CM'\n\tspeed_test '27249' 'Nanjing 5G CM'\n\tspeed_test '26404' 'Hefei 5G CM'\n\tspeed_test '28491' 'Changsha 5G CM'\n\n\trm -rf speedtest*\n}\n\nprint_speedtest_fast() {\n\tprintf \"%-18s%-18s%-20s%-12s\\n\" \" Node Name\" \"Upload Speed\" \"Download Speed\" \"Latency\" | tee -a $log\n speed_test '' 'Speedtest.net'\n speed_fast_com\n speed_test '27377' 'Beijing 5G CT'\n\tspeed_test '24447' 'ShangHai 5G CU'\n\tspeed_test '27249' 'Nanjing 5G CM'\n\t \n\trm -rf speedtest*\n}\n\nspeed_fast_com() {\n\ttemp=$(python fast_com_example_usage.py 2>&amp;1)\n\tis_down=$(echo \"$temp\" | grep 'Result') \n\t\tif &#91;&#91; ${is_down} ]]; then\n\t temp1=$(echo \"$temp\" | awk -F ':' '\/Result\/{print $2}')\n\t temp2=$(echo \"$temp1\" | awk -F ' ' '\/Mbps\/{print $1}')\n\t local REDownload=\"$temp2 Mbit\/s\"\n\t local reupload=\"0.00 Mbit\/s\"\n\t local relatency=\"-\"\n\t local nodeName=\"Fast.com\"\n\n\t printf \"${YELLOW}%-18s${GREEN}%-18s${RED}%-20s${SKYBLUE}%-12s${PLAIN}\\n\" \" ${nodeName}\" \"${reupload}\" \"${REDownload}\" \"${relatency}\" | tee -a $log\n\t\telse\n\t local cerror=\"ERROR\"\n\t\tfi\n\trm -rf fast_com_example_usage.py\n\trm -rf fast_com.py\n\n}\n\nio_test() {\n (LANG=C dd if=\/dev\/zero of=test_file_$$ bs=512K count=$1 conv=fdatasync &amp;&amp; rm -f test_file_$$ ) 2>&amp;1 | awk -F, '{io=$NF} END { print io}' | sed 's\/^&#91; \\t]*\/\/;s\/&#91; \\t]*$\/\/'\n}\n\ncalc_disk() {\n local total_size=0\n local array=$@\n for size in ${array&#91;@]}\n do\n &#91; \"${size}\" == \"0\" ] &amp;&amp; size_t=0 || size_t=`echo ${size:0:${#size}-1}`\n &#91; \"`echo ${size:(-1)}`\" == \"K\" ] &amp;&amp; size=0\n &#91; \"`echo ${size:(-1)}`\" == \"M\" ] &amp;&amp; size=$( awk 'BEGIN{printf \"%.1f\", '$size_t' \/ 1024}' )\n &#91; \"`echo ${size:(-1)}`\" == \"T\" ] &amp;&amp; size=$( awk 'BEGIN{printf \"%.1f\", '$size_t' * 1024}' )\n &#91; \"`echo ${size:(-1)}`\" == \"G\" ] &amp;&amp; size=${size_t}\n total_size=$( awk 'BEGIN{printf \"%.1f\", '$total_size' + '$size'}' )\n done\n echo ${total_size}\n}\n\npower_time() {\n\n\tresult=$(smartctl -a $(result=$(cat \/proc\/mounts) &amp;&amp; echo $(echo \"$result\" | awk '\/data=ordered\/{print $1}') | awk '{print $1}') 2>&amp;1) &amp;&amp; power_time=$(echo \"$result\" | awk '\/Power_On\/{print $10}') &amp;&amp; echo \"$power_time\"\n}\n\ninstall_smart() {\n\tif &#91; ! -e '\/usr\/sbin\/smartctl' ]; then\n\t\techo \"Installing Smartctl ...\"\n\t if &#91; \"${release}\" == \"centos\" ]; then\n\t \tyum update > \/dev\/null 2>&amp;1\n\t yum -y install smartmontools > \/dev\/null 2>&amp;1\n\t else\n\t \tapt-get update > \/dev\/null 2>&amp;1\n\t apt-get -y install smartmontools > \/dev\/null 2>&amp;1\n\t fi \n\tfi\n}\n\nip_info4(){\n\tip_date=$(curl -4 -s http:\/\/api.ip.la\/en?json)\n\techo $ip_date > ip_json.json\n\tisp=$(python tools.py geoip isp)\n\tas_tmp=$(python tools.py geoip as)\n\tasn=$(echo $as_tmp | awk -F ' ' '{print $1}')\n\torg=$(python tools.py geoip org)\n\tif &#91; -z \"ip_date\" ]; then\n\t\techo $ip_date\n\t\techo \"hala\"\n\t\tcountry=$(python tools.py ipip country_name)\n\t\tcity=$(python tools.py ipip city)\n\t\tcountryCode=$(python tools.py ipip country_code)\n\t\tregion=$(python tools.py ipip province)\n\telse\n\t\tcountry=$(python tools.py geoip country)\n\t\tcity=$(python tools.py geoip city)\n\t\tcountryCode=$(python tools.py geoip countryCode)\n\t\tregion=$(python tools.py geoip regionName)\t\n\tfi\n\tif &#91; -z \"$city\" ]; then\n\t\tcity=${region}\n\tfi\n\n\techo -e \" ASN &amp; ISP : ${SKYBLUE}$asn, $isp${PLAIN}\" | tee -a $log\n\techo -e \" Organization : ${YELLOW}$org${PLAIN}\" | tee -a $log\n\techo -e \" Location : ${SKYBLUE}$city, ${YELLOW}$country \/ $countryCode${PLAIN}\" | tee -a $log\n\techo -e \" Region : ${SKYBLUE}$region${PLAIN}\" | tee -a $log\n\n\trm -rf tools.py\n\trm -rf ip_json.json\n}\n\nvirt_check(){\n\tif hash ifconfig 2>\/dev\/null; then\n\t\teth=$(ifconfig)\n\tfi\n\n\tvirtualx=$(dmesg) 2>\/dev\/null\n\n if &#91; $(which dmidecode) ]; then\n\t\tsys_manu=$(dmidecode -s system-manufacturer) 2>\/dev\/null\n\t\tsys_product=$(dmidecode -s system-product-name) 2>\/dev\/null\n\t\tsys_ver=$(dmidecode -s system-version) 2>\/dev\/null\n\telse\n\t\tsys_manu=\"\"\n\t\tsys_product=\"\"\n\t\tsys_ver=\"\"\n\tfi\n\t\n\tif grep docker \/proc\/1\/cgroup -qa; then\n\t virtual=\"Docker\"\n\telif grep lxc \/proc\/1\/cgroup -qa; then\n\t\tvirtual=\"Lxc\"\n\telif grep -qa container=lxc \/proc\/1\/environ; then\n\t\tvirtual=\"Lxc\"\n\telif &#91;&#91; -f \/proc\/user_beancounters ]]; then\n\t\tvirtual=\"OpenVZ\"\n\telif &#91;&#91; \"$virtualx\" == *kvm-clock* ]]; then\n\t\tvirtual=\"KVM\"\n\telif &#91;&#91; \"$cname\" == *KVM* ]]; then\n\t\tvirtual=\"KVM\"\n\telif &#91;&#91; \"$cname\" == *QEMU* ]]; then\n\t\tvirtual=\"KVM\"\n\telif &#91;&#91; \"$virtualx\" == *\"VMware Virtual Platform\"* ]]; then\n\t\tvirtual=\"VMware\"\n\telif &#91;&#91; \"$virtualx\" == *\"Parallels Software International\"* ]]; then\n\t\tvirtual=\"Parallels\"\n\telif &#91;&#91; \"$virtualx\" == *VirtualBox* ]]; then\n\t\tvirtual=\"VirtualBox\"\n\telif &#91;&#91; -e \/proc\/xen ]]; then\n\t\tvirtual=\"Xen\"\n\telif &#91;&#91; \"$sys_manu\" == *\"Microsoft Corporation\"* ]]; then\n\t\tif &#91;&#91; \"$sys_product\" == *\"Virtual Machine\"* ]]; then\n\t\t\tif &#91;&#91; \"$sys_ver\" == *\"7.0\"* || \"$sys_ver\" == *\"Hyper-V\" ]]; then\n\t\t\t\tvirtual=\"Hyper-V\"\n\t\t\telse\n\t\t\t\tvirtual=\"Microsoft Virtual Machine\"\n\t\t\tfi\n\t\tfi\n\telse\n\t\tvirtual=\"Dedicated\"\n\tfi\n}\n\npower_time_check(){\n\techo -ne \" Power time of disk : \"\n\tinstall_smart\n\tptime=$(power_time)\n\techo -e \"${SKYBLUE}$ptime Hours${PLAIN}\"\n}\n\nfreedisk() {\n\tfreespace=$( df -m . | awk 'NR==2 {print $4}' )\n\tif &#91;&#91; $freespace == \"\" ]]; then\n\t\t$freespace=$( df -m . | awk 'NR==3 {print $3}' )\n\tfi\n\tif &#91;&#91; $freespace -gt 1024 ]]; then\n\t\tprintf \"%s\" $((1024*2))\n\telif &#91;&#91; $freespace -gt 512 ]]; then\n\t\tprintf \"%s\" $((512*2))\n\telif &#91;&#91; $freespace -gt 256 ]]; then\n\t\tprintf \"%s\" $((256*2))\n\telif &#91;&#91; $freespace -gt 128 ]]; then\n\t\tprintf \"%s\" $((128*2))\n\telse\n\t\tprintf \"1\"\n\tfi\n}\n\nprint_io() {\n\tif &#91;&#91; $1 == \"fast\" ]]; then\n\t\twritemb=$((128*2))\n\telse\n\t\twritemb=$(freedisk)\n\tfi\n\t\n\twritemb_size=\"$(( writemb \/ 2 ))MB\"\n\tif &#91;&#91; $writemb_size == \"1024MB\" ]]; then\n\t\twritemb_size=\"1.0GB\"\n\tfi\n\n\tif &#91;&#91; $writemb != \"1\" ]]; then\n\t\techo -n \" I\/O Speed( $writemb_size ) : \" | tee -a $log\n\t\tio1=$( io_test $writemb )\n\t\techo -e \"${YELLOW}$io1${PLAIN}\" | tee -a $log\n\t\techo -n \" I\/O Speed( $writemb_size ) : \" | tee -a $log\n\t\tio2=$( io_test $writemb )\n\t\techo -e \"${YELLOW}$io2${PLAIN}\" | tee -a $log\n\t\techo -n \" I\/O Speed( $writemb_size ) : \" | tee -a $log\n\t\tio3=$( io_test $writemb )\n\t\techo -e \"${YELLOW}$io3${PLAIN}\" | tee -a $log\n\t\tioraw1=$( echo $io1 | awk 'NR==1 {print $1}' )\n\t\t&#91; \"`echo $io1 | awk 'NR==1 {print $2}'`\" == \"GB\/s\" ] &amp;&amp; ioraw1=$( awk 'BEGIN{print '$ioraw1' * 1024}' )\n\t\tioraw2=$( echo $io2 | awk 'NR==1 {print $1}' )\n\t\t&#91; \"`echo $io2 | awk 'NR==1 {print $2}'`\" == \"GB\/s\" ] &amp;&amp; ioraw2=$( awk 'BEGIN{print '$ioraw2' * 1024}' )\n\t\tioraw3=$( echo $io3 | awk 'NR==1 {print $1}' )\n\t\t&#91; \"`echo $io3 | awk 'NR==1 {print $2}'`\" == \"GB\/s\" ] &amp;&amp; ioraw3=$( awk 'BEGIN{print '$ioraw3' * 1024}' )\n\t\tioall=$( awk 'BEGIN{print '$ioraw1' + '$ioraw2' + '$ioraw3'}' )\n\t\tioavg=$( awk 'BEGIN{printf \"%.1f\", '$ioall' \/ 3}' )\n\t\techo -e \" Average I\/O Speed : ${YELLOW}$ioavg MB\/s${PLAIN}\" | tee -a $log\n\telse\n\t\techo -e \" ${RED}Not enough space!${PLAIN}\"\n\tfi\n}\n\nprint_system_info() {\n\techo -e \" CPU Model : ${SKYBLUE}$cname${PLAIN}\" | tee -a $log\n\techo -e \" CPU Cores : ${YELLOW}$cores Cores ${SKYBLUE}$freq MHz $arch${PLAIN}\" | tee -a $log\n\techo -e \" CPU Cache : ${SKYBLUE}$corescache ${PLAIN}\" | tee -a $log\n\techo -e \" OS : ${SKYBLUE}$opsy ($lbit Bit) ${YELLOW}$virtual${PLAIN}\" | tee -a $log\n\techo -e \" Kernel : ${SKYBLUE}$kern${PLAIN}\" | tee -a $log\n\techo -e \" Total Space : ${SKYBLUE}$disk_used_size GB \/ ${YELLOW}$disk_total_size GB ${PLAIN}\" | tee -a $log\n\techo -e \" Total RAM : ${SKYBLUE}$uram MB \/ ${YELLOW}$tram MB ${SKYBLUE}($bram MB Buff)${PLAIN}\" | tee -a $log\n\techo -e \" Total SWAP : ${SKYBLUE}$uswap MB \/ $swap MB${PLAIN}\" | tee -a $log\n\techo -e \" Uptime : ${SKYBLUE}$up${PLAIN}\" | tee -a $log\n\techo -e \" Load Average : ${SKYBLUE}$load${PLAIN}\" | tee -a $log\n\techo -e \" TCP CC : ${YELLOW}$tcpctrl${PLAIN}\" | tee -a $log\n}\n\nprint_end_time() {\n\tend=$(date +%s) \n\ttime=$(( $end - $start ))\n\tif &#91;&#91; $time -gt 60 ]]; then\n\t\tmin=$(expr $time \/ 60)\n\t\tsec=$(expr $time % 60)\n\t\techo -ne \" Finished in : ${min} min ${sec} sec\" | tee -a $log\n\telse\n\t\techo -ne \" Finished in : ${time} sec\" | tee -a $log\n\tfi\n\n\tprintf '\\n' | tee -a $log\n\n\tbj_time=$(curl -s http:\/\/cgi.im.qq.com\/cgi-bin\/cgi_svrtime)\n\n\tif &#91;&#91; $(echo $bj_time | grep \"html\") ]]; then\n\t\tbj_time=$(date -u +%Y-%m-%d\" \"%H:%M:%S -d '+8 hours')\n\tfi\n\techo \" Timestamp : $bj_time GMT+8\" | tee -a $log\n\techo \" Results : $log\"\n}\n\nget_system_info() {\n\tcname=$( awk -F: '\/model name\/ {name=$2} END {print name}' \/proc\/cpuinfo | sed 's\/^&#91; \\t]*\/\/;s\/&#91; \\t]*$\/\/' )\n\tcores=$( awk -F: '\/model name\/ {core++} END {print core}' \/proc\/cpuinfo )\n\tfreq=$( awk -F: '\/cpu MHz\/ {freq=$2} END {print freq}' \/proc\/cpuinfo | sed 's\/^&#91; \\t]*\/\/;s\/&#91; \\t]*$\/\/' )\n\tcorescache=$( awk -F: '\/cache size\/ {cache=$2} END {print cache}' \/proc\/cpuinfo | sed 's\/^&#91; \\t]*\/\/;s\/&#91; \\t]*$\/\/' )\n\ttram=$( free -m | awk '\/Mem\/ {print $2}' )\n\turam=$( free -m | awk '\/Mem\/ {print $3}' )\n\tbram=$( free -m | awk '\/Mem\/ {print $6}' )\n\tswap=$( free -m | awk '\/Swap\/ {print $2}' )\n\tuswap=$( free -m | awk '\/Swap\/ {print $3}' )\n\tup=$( 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 )\n\tload=$( w | head -1 | awk -F'load average:' '{print $2}' | sed 's\/^&#91; \\t]*\/\/;s\/&#91; \\t]*$\/\/' )\n\topsy=$( get_opsy )\n\tarch=$( uname -m )\n\tlbit=$( getconf LONG_BIT )\n\tkern=$( uname -r )\n\n\tdisk_size1=$( LANG=C df -hPl | grep -wvE '\\-|none|tmpfs|overlay|shm|udev|devtmpfs|by-uuid|chroot|Filesystem' | awk '{print $2}' )\n\tdisk_size2=$( LANG=C df -hPl | grep -wvE '\\-|none|tmpfs|overlay|shm|udev|devtmpfs|by-uuid|chroot|Filesystem' | awk '{print $3}' )\n\tdisk_total_size=$( calc_disk ${disk_size1&#91;@]} )\n\tdisk_used_size=$( calc_disk ${disk_size2&#91;@]} )\n\n\ttcpctrl=$( sysctl net.ipv4.tcp_congestion_control | awk -F ' ' '{print $3}' )\n\n\tvirt_check\n}\n\nprint_intro() {\n\tprintf ' Superbench.sh -- https:\/\/www.oldking.net\/350.html\\n' | tee -a $log\n\tprintf \" Mode : \\e${GREEN}%s\\e${PLAIN} Version : \\e${GREEN}%s${PLAIN}\\n\" $mode_name 1.1.7 | tee -a $log\n\tprintf ' Usage : wget -qO- sb.oldking.net | bash\\n' | tee -a $log\n}\n\nsharetest() {\n\techo \" Share result:\" | tee -a $log\n\techo \" \u00b7 $result_speed\" | tee -a $log\n\tlog_preupload\n\tcase $1 in\n\t'ubuntu')\n\t\tshare_link=\"https:\/\/paste.ubuntu.com\"$( curl -v --data-urlencode \"content@$log_up\" -d \"poster=superbench.sh\" -d \"syntax=text\" \"https:\/\/paste.ubuntu.com\" 2>&amp;1 | \\\n\t\t\tgrep \"Location\" | awk '{print $3}' );;\n\t'haste' )\n\t\tshare_link=$( curl -X POST -s -d \"$(cat $log)\" https:\/\/hastebin.com\/documents | awk -F '\"' '{print \"https:\/\/hastebin.com\/\"$4}' );;\n\t'clbin' )\n\t\tshare_link=$( curl -sF 'clbin=&lt;-' https:\/\/clbin.com &lt; $log );;\n\t'ptpb' )\n\t\tshare_link=$( curl -sF c=@- https:\/\/ptpb.pw\/?u=1 &lt; $log );;\n\tesac\n\n\techo \" \u00b7 $share_link\" | tee -a $log\n\tnext\n\techo \"\"\n\trm -f $log_up\n\n}\n\nlog_preupload() {\n\tlog_up=\"$HOME\/superbench_upload.log\"\n\ttrue > $log_up\n\t$(cat superbench.log 2>&amp;1 | sed -r \"s\/\\x1B\\&#91;(&#91;0-9]{1,2}(;&#91;0-9]{1,2})?)?&#91;m|K]\/\/g\" > $log_up)\n}\n\ncleanup() {\n\trm -f test_file_*\n\trm -rf speedtest*\n\trm -f fast_com*\n\trm -f tools.py\n\trm -f ip_json.json\n}\n\nbench_all(){\n\tmode_name=\"Standard\"\n\tabout;\n\tbenchinit;\n\tclear\n\tnext;\n\tprint_intro;\n\tnext;\n\tget_system_info;\n\tprint_system_info;\n\tip_info4;\n\tnext;\n\tprint_io;\n\tnext;\n\tprint_speedtest;\n\tnext;\n\tprint_end_time;\n\tnext;\n\tcleanup;\n\tsharetest ubuntu;\n}\n\nfast_bench(){\n\tmode_name=\"Fast\"\n\tabout;\n\tbenchinit;\n\tclear\n\tnext;\n\tprint_intro;\n\tnext;\n\tget_system_info;\n\tprint_system_info;\n\tip_info4;\n\tnext;\n\tprint_io fast;\n\tnext;\n\tprint_speedtest_fast;\n\tnext;\n\tprint_end_time;\n\tnext;\n\tcleanup;\n}\n\nlog=\".\/superbench.log\"\ntrue > $log\nspeedLog=\".\/speedtest.log\"\ntrue > $speedLog\n\ncase $1 in\n\t'info'|'-i'|'--i'|'-info'|'--info' )\n\t\tabout;sleep 3;next;get_system_info;print_system_info;next;;\n 'version'|'-v'|'--v'|'-version'|'--version')\n\t\tnext;about;next;;\n \t'io'|'-io'|'--io'|'-drivespeed'|'--drivespeed' )\n\t\tnext;print_io;next;;\n\t'speed'|'-speed'|'--speed'|'-speedtest'|'--speedtest'|'-speedcheck'|'--speedcheck' )\n\t\tabout;benchinit;next;print_speedtest;next;cleanup;;\n\t'ip'|'-ip'|'--ip'|'geoip'|'-geoip'|'--geoip' )\n\t\tabout;benchinit;next;ip_info4;next;cleanup;;\n\t'bench'|'-a'|'--a'|'-all'|'--all'|'-bench'|'--bench' )\n\t\tbench_all;;\n\t'about'|'-about'|'--about' )\n\t\tabout;;\n\t'fast'|'-f'|'--f'|'-fast'|'--fast' )\n\t\tfast_bench;;\n\t'share'|'-s'|'--s'|'-share'|'--share' )\n\t\tbench_all;\n\t\tis_share=\"share\"\n\t\tif &#91;&#91; $2 == \"\" ]]; then\n\t\t\tsharetest ubuntu;\n\t\telse\n\t\t\tsharetest $2;\n\t\tfi\n\t\t;;\n\t'debug'|'-d'|'--d'|'-debug'|'--debug' )\n\t\tget_ip_whois_org_name;;\n*)\n bench_all;;\nesac\n\nif &#91;&#91; ! $is_share == \"share\" ]]; then\n\tcase $2 in\n\t\t'share'|'-s'|'--s'|'-share'|'--share' )\n\t\t\tif &#91;&#91; $3 == '' ]]; then\n\t\t\t\tsharetest ubuntu;\n\t\t\telse\n\t\t\t\tsharetest $3;\n\t\t\tfi\n\t\t\t;;\n\tesac\nfi<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4b\u8bd5\u4e3b\u673a\u547d\u4ee4#wget -qO- git.io\/superbench.sh | bash \u6e90\u7801 superbe [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,15],"tags":[353],"class_list":["post-311","post","type-post","status-publish","format-standard","hentry","category-linux","category-wordpress","tag-linux"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/311\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}