Update nodeloc_vps_autotest.sh

This commit is contained in:
Jensfrank 2024-06-26 15:32:43 +08:00 committed by GitHub
parent f81ce6916f
commit aab25ff3c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,23 @@
#!/bin/bash
# 定义版本
VERSION="1.0.0"
# 定义颜色
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 定义渐变颜色数组
colors=(
'\033[38;2;255;0;0m' # 红色
'\033[38;2;255;127;0m' # 橙色
'\033[38;2;255;255;0m' # 黄色
'\033[38;2;0;255;0m' # 绿色
'\033[38;2;0;0;255m' # 蓝色
)
# 检查 root 权限并获取 sudo 权限
if [ "$(id -u)" != "0" ]; then
echo "此脚本需要 root 权限运行。"
@ -105,6 +117,43 @@ sum_run_times() {
# 调用函数获取统计数据
sum_run_times
# 输出欢迎信息
show_welcome() {
echo ""
echo -e "${YELLOW}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "Nodeloc_VPS_自动脚本测试 $VERSION"
echo "GitHub地址: https://github.com/everett7623/nodeloc_vps_test"
echo "VPS选购: https://www.nodeloc.com/vps"
echo ""
echo -e "${colors[0]}# # ##### #### ###### # #### #### # # #### #### ${NC}"
echo -e "${colors[1]}## # # # # # # # # # # # # # # # # ${NC}"
echo -e "${colors[2]}# # # # # # # ##### # # # # # # #### #### ${NC}"
echo -e "${colors[3]}# # # # # # # # # # # # # # # # ${NC}"
echo -e "${colors[4]}# # # # # # # # # # # # # # # # # # # ${NC}"
echo -e "${colors[0]}# ## ##### #### ###### ###### #### #### #### ##### #### ${NC}"
echo ""
echo "支持Ubuntu/Debian"
echo ""
echo -e "今日运行次数: ${PURPLE}$daily_count${NC} 次,累计运行次数: ${PURPLE}$total_count${NC}"
echo ""
echo -e "${YELLOW}---------------------------------By'Jensfrank---------------------------------${NC}"
echo ""
echo "本一键脚本将测试以下项目:"
echo "1. Yabs"
echo "2. 融合怪"
echo "3. IP质量"
echo "4. 流媒体解锁"
echo "5. 响应测试"
echo "6. 多线程测试"
echo "7. 单线程测试"
echo "8. 回程路由"
echo ""
echo -e "${YELLOW}按任意键开始测试,测试时间较长,请耐心等待...${NC}"
read -n 1 -s
clear
}
# 运行所有测试
run_all_tests() {
echo "开始运行测试..."
@ -229,10 +278,9 @@ copy_to_clipboard() {
# 主函数
main() {
install_dependencies
show_welcome
run_all_tests
echo -e "${GREEN}所有测试完成。点击屏幕任意位置复制结果。${NC}"
echo ""
echo -e "今日运行次数: ${YELLOW}$daily_count${NC} 次,累计运行次数: ${YELLOW}$total_count${NC}"
read -n 1 -s
copy_to_clipboard
}