Skip to content

Commit

Permalink
fix percent and temperature
Browse files Browse the repository at this point in the history
Remove '25' from %, remove ℃ code
  • Loading branch information
zzsj0928 authored Sep 19, 2020
1 parent 9d060fc commit 1d9a422
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions root/usr/bin/serverchand/serverchand
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ function cputop(){
local top_load=`cat ${dir}top|awk 'NR=='${top_i}|awk '{print $7}'`
local temp_top="${top_name} ${top_load}"
[ ! -z "$1" ] && local logtop="$logtop $temp_top"
[ -z "$1" ] && content="${content}${markdown_linefeed}${markdown_tab}${temp_top}25"
[ -z "$1" ] && content="${content}${markdown_linefeed}${markdown_tab}${temp_top}"
local i=`expr ${i} + 1`
fi
local top_i=`expr ${top_i} + 1`
Expand All @@ -751,12 +751,12 @@ function send(){
local systemstatustime=`cat /proc/uptime|awk -F. '{run_days=$1 / 86400;run_hour=($1 % 86400)/3600;run_minute=($1 % 3600)/60;run_second=$1 % 60;printf("运行时间:%d天%d时%d分%d秒",run_days,run_hour,run_minute,run_second)}'`;unset run_days run_hour run_minute run_second
local send_content="${send_content}${markdown_splitline}#### **<font color=#76CCFF>系统运行状态</font>**"
local send_content="${send_content}${markdown_linefeed}${markdown_tab}平均负载:${systemload}"
local send_content="${send_content}${markdown_linefeed}${markdown_tab}CPU占用:${cpuload}25"
local send_content="${send_content}${markdown_linefeed}${markdown_tab}内存占用:${ramload}25"
local send_content="${send_content}${markdown_linefeed}${markdown_tab}CPU占用:${cpuload}"
local send_content="${send_content}${markdown_linefeed}${markdown_tab}内存占用:${ramload}"
local send_content="${send_content}${markdown_linefeed}${markdown_tab}${systemstatustime}"
fi

[ ! -z "$router_temp" ] && [ "$router_temp" -eq "1" ] && local cputemp=`soc_temp` && local send_content="${send_content}${markdown_splitline}#### 设备温度${markdown_linefeed}${markdown_tab}CPU:${cputemp}%e2%84%83" #%e2%84%83="℃"
[ ! -z "$router_temp" ] && [ "$router_temp" -eq "1" ] && local cputemp=`soc_temp` && local send_content="${send_content}${markdown_splitline}#### 设备温度${markdown_linefeed}${markdown_tab}CPU:${cputemp}" #%e2%84%83="℃"

if [ ! -z "$router_wan" ] && [ "$router_wan" -eq "1" ]; then
local send_wanIP=`getip wanipv4`;local send_hostIP=`getip hostipv4`
Expand Down

0 comments on commit 1d9a422

Please sign in to comment.