18 lines
548 B
Bash
18 lines
548 B
Bash
#!/bin/bash
|
|
echo "🌐 网络测速工具"
|
|
echo "测试中..."
|
|
|
|
result=$(curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 - --simple)
|
|
|
|
echo "$result" | while read line; do
|
|
if [[ $line == Ping:* ]]; then
|
|
echo "🔄 延迟: $(echo $line | cut -d' ' -f2-)"
|
|
elif [[ $line == Download:* ]]; then
|
|
echo "⬇️ 下载: $(echo $line | cut -d' ' -f2-)"
|
|
elif [[ $line == Upload:* ]]; then
|
|
echo "⬆️ 上传: $(echo $line | cut -d' ' -f2-)"
|
|
fi
|
|
done
|
|
|
|
echo "✅ 测试完成"
|