Update nodeloc_vps_autotest.sh

This commit is contained in:
Jensfrank 2024-06-26 16:59:31 +08:00 committed by GitHub
parent bc0b205670
commit a7ce924f28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,21 +28,21 @@ if [ "$(id -u)" != "0" ]; then
echo "已获取 sudo 权限。" echo "已获取 sudo 权限。"
fi fi
#更新系统 # 更新系统
update_system() { update_system() {
if command -v apt &>/dev/null; then if command -v apt &>/dev/null; then
apt-get update && apt-get upgrade -y apt-get update && apt-get upgrade -y
elif command -v dnf &>/dev/null; then elif command -v dnf &>/dev/null; then
dnf check-update && dnf upgrade -y dnf check-update && dnf upgrade -y
elif command -v yum &>/dev/null; then elif command -v yum &>/dev/null; then
yum check-update && yum upgrade -y yum check-update && yum upgrade -y
elif command -v apk &>/dev/null; then elif command -v apk &>/dev/null; then
apk update && apk upgrade apk update && apk upgrade
else else
echo -e "${RED}不支持的Linux发行版${NC}" echo -e "${RED}不支持的Linux发行版${NC}"
return 1 return 1
fi fi
return 0 return 0
} }
update_system update_system
@ -186,59 +186,59 @@ run_all_tests() {
# AutoTrace三网回程路由 # AutoTrace三网回程路由
echo "运行${YELLOW}AutoTrace三网回程路由...${NC}" echo "运行${YELLOW}AutoTrace三网回程路由...${NC}"
autotrace_result=$(run_and_capture "wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && bash AutoTrace.sh") autotrace_result=$(run_and_capture "wget -N --no-check-certificate https://raw.githubusercontent.com/Chennhaoo/Shell_Bash/master/AutoTrace.sh && chmod +x AutoTrace.sh && echo '1' | bash AutoTrace.sh)
# 生成Markdown结果
echo "生成${YELLOW}Markdown${NC}结果..."
result="
# 测试报告
*此报告由Nodeloc_VPS_自动脚本测试生成*
# 格式化结果 [tabs]
format_results
}
# 格式化结果为 Markdown
format_results() {
result="[tabs]
[tab=\"YABS\"] [tab=\"YABS\"]
\`\`\` \\\
$yabs_result $yabs_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"融合怪\"] [tab=\"融合怪\"]
\`\`\` \\\
$fusion_result $fusion_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"IP质量\"] [tab=\"IP质量\"]
\`\`\` \\\
$ip_quality_result $ip_quality_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"流媒体\"] [tab=\"流媒体\"]
\`\`\` \\\
$streaming_result $streaming_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"响应\"] [tab=\"响应\"]
\`\`\` \\\
$response_result $response_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"多线程测速\"] [tab=\"多线程测速\"]
\`\`\` \\\
$speedtest_multi_result $speedtest_multi_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"单线程测速\"] [tab=\"单线程测速\"]
\`\`\` \\\
$speedtest_single_result $speedtest_single_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"iperf3\"] [tab=\"iperf3\"]
\`\`\` \\\
\`\`\` \\\
[/tab] [/tab]
[tab=\"回程路由\"] [tab=\"回程路由\"]
\`\`\` \\\
$autotrace_result $autotrace_result
\`\`\` \\\
[/tab] [/tab]
[tab=\"去程路由\"] [tab=\"去程路由\"]