Skip to content

Commit

Permalink
fix:ping结果打印到logread
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzzzhy committed Dec 22, 2023
1 parent 4183e51 commit 638aab1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hi/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2746,12 +2746,13 @@ fi
cat >/tmp/net_ping_detected<<EOF
node_host={{.nodeHost}}
import_ip=\$(uci get wireguard.@peers[0].end_point|awk -F':' '{print \$1}')
echo "#------------ping start--------------\$(date)">/var/log/ping.log
oping -c25 -i 2 -w 2 \$import_ip \$node_host 8.8.8.8 |grep 'timeout' |logger -t ping
oping -c25 -i 2 -w 2 -O /var/log/ping.log \$import_ip \$node_host 8.8.8.8 |grep 'timeout' |logger -t ping
EOF
host="{{.logUrl}}/$(uci get rtty.general.id)$(_sign)"
dmesg >/var/log/dmesg.log
curl -sF file=@/var/log/dmesg.log "$host""&log_type=dmesg"
curl -F file=@/var/log/ping.log "$host""&log_type=exec"
[ $? == 0 ] && rm /var/log/exec.log
`)

// 直接执行--已添加set -e
Expand Down

0 comments on commit 638aab1

Please sign in to comment.