Skip to content

Commit

Permalink
Update test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
redrainl authored May 16, 2024
1 parent e1aa590 commit aec8d47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion speedtest/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ rm -f test.html tempip.txt tmp_onlyip $ipfile
while IFS= read -r ip; do
while IFS= read -r port; do
# 尝试连接 IP 地址和端口号
nc -w 1 -z $ip $port
echo "nc -w 1 -z $ip $port"
nc -w 1 -z $ip $port
output=$(nc -w 1 -z "$ip" "$port" 2>&1)
# 如果连接成功,且输出包含 "succeeded",则将结果保存到输出文件中
if [[ $output == *"succeeded"* ]]; then
Expand Down

0 comments on commit aec8d47

Please sign in to comment.