mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-12-29 09:45:18 +00:00
Update nodeloc_vps_autotest_yabs.sh
This commit is contained in:
parent
38e2a2a5c4
commit
0d75f87377
@ -55,13 +55,6 @@ install_dependencies() {
|
|||||||
clear
|
clear
|
||||||
}
|
}
|
||||||
|
|
||||||
# 函数:运行命令并捕获输出
|
|
||||||
run_and_capture() {
|
|
||||||
local output
|
|
||||||
output=$(eval "$1" 2>&1)
|
|
||||||
echo "$output"
|
|
||||||
}
|
|
||||||
|
|
||||||
# 检测VPS地理位置
|
# 检测VPS地理位置
|
||||||
detect_region() {
|
detect_region() {
|
||||||
local country
|
local country
|
||||||
@ -136,9 +129,16 @@ show_welcome() {
|
|||||||
clear
|
clear
|
||||||
}
|
}
|
||||||
|
|
||||||
# 创建results.md
|
# 定义一个数组来存储每个命令的输出
|
||||||
touch /root/results.md
|
declare -a test_results
|
||||||
chmod 777 /root/results.md
|
|
||||||
|
# 在每个命令执行后保存结果
|
||||||
|
run_and_capture() {
|
||||||
|
local command_output
|
||||||
|
command_output=$(eval "$1" 2>&1)
|
||||||
|
test_results+=("$command_output")
|
||||||
|
echo "$command_output"
|
||||||
|
}
|
||||||
|
|
||||||
# 运行所有测试
|
# 运行所有测试
|
||||||
run_all_tests() {
|
run_all_tests() {
|
||||||
@ -163,8 +163,8 @@ $yabs_result
|
|||||||
[/tab]
|
[/tab]
|
||||||
[/tabs]"
|
[/tabs]"
|
||||||
|
|
||||||
echo "$result" > /root/results.md
|
echo "$result" > results.md
|
||||||
echo -e "${GREEN}结果已保存到 /root/results.md 文件中。${NC}"
|
echo -e "${GREEN}结果已保存到 results.md 文件中。${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 复制结果到剪贴板
|
# 复制结果到剪贴板
|
||||||
|
Loading…
Reference in New Issue
Block a user