Compare commits

..

18 Commits

Author SHA1 Message Date
Jensfrank
3cec8b14f9
Update Nlbench.sh 2024-09-07 23:09:58 +08:00
Jensfrank
735b635490
Update Nlbench.sh 2024-09-07 23:03:37 +08:00
Jensfrank
c5732df15a
Update Nlbench.sh 2024-09-07 22:58:02 +08:00
Jensfrank
90b2807070
Update Nlbench.sh 2024-09-07 22:57:26 +08:00
Jensfrank
2fcff740b5
Update Nlbench.sh 2024-09-07 22:54:12 +08:00
Jensfrank
fb3b27a67a
Update Nlbench.sh 2024-09-07 22:53:26 +08:00
Jensfrank
2da6546e4d
Update Nlbench.sh 2024-09-07 22:47:28 +08:00
Jensfrank
6f41c63ba4
Update Nlbench.sh 2024-09-07 22:42:09 +08:00
Jensfrank
8eeda69163
Update Nlbench.sh 2024-09-07 22:40:08 +08:00
Jensfrank
688c07899d
Update Nlbench.sh 2024-09-07 21:58:58 +08:00
Jensfrank
514909f411
Update version.sh 2024-09-07 19:15:37 +08:00
Jensfrank
7b4120350c
Update Nlbench.sh 2024-09-07 19:15:11 +08:00
Jensfrank
6911d821db
Update version.sh 2024-09-07 18:47:30 +08:00
Jensfrank
98c7c4abf4
Update Nlbench.sh 2024-09-07 18:47:19 +08:00
Jensfrank
ea01c5d727
Update version.sh 2024-09-07 18:40:59 +08:00
Jensfrank
0b7ae16285
Update Nlbench.sh 2024-09-07 18:40:45 +08:00
Jensfrank
169c63e49b
Update Nlbench.sh 2024-09-07 18:34:42 +08:00
Jensfrank
3095f30989
Update Nlbench.sh 2024-09-07 18:07:31 +08:00
2 changed files with 24 additions and 47 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
# 定义版本
CURRENT_VERSION="2024-09-07 v1.2.0" # 最新版本号
CURRENT_VERSION="2024-09-07 v1.2.3" # 最新版本号
SCRIPT_URL="https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/Nlbench.sh"
VERSION_URL="https://raw.githubusercontent.com/everett7623/nodeloc_vps_test/main/version.sh"
PASTE_SERVICE_URL="http://nodeloc.uukk.de/test/"
@ -322,22 +322,6 @@ detect_region() {
esac
}
# 服务器 VPS 信息
AUXILIARY_VPS="107.189.11.25"
IPERF_PORT=5201
TEST_DURATION=30
run_iperf3_test() {
echo -e "${GREEN}服务端VPS位于卢森堡${NC}"
echo -e "${GREEN}连接到服务端进行iperf3测试。。。${NC}"
timeout ${TEST_DURATION}s iperf3 -c $AUXILIARY_VPS -p $IPERF_PORT -t $TEST_DURATION
if [ $? -eq 0 ]; then
echo -e "${YELLOW}iperf3 测试完成${NC}"
else
echo -e "${RED}iperf3 测试失败或超时${NC}"
fi
}
# 统计使用次数
sum_run_times() {
local COUNT=$(wget --no-check-certificate -qO- --tries=2 --timeout=2 "https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Feverett7623%2Fnodeloc_vps_test%2Fblob%2Fmain%2FNlbench.sh" 2>&1 | grep -m1 -oE "[0-9]+[ ]+/[ ]+[0-9]+")
@ -442,17 +426,8 @@ run_script() {
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_single_thread"
;;
# iperf3测试
8)
echo -e "运行${YELLOW}iperf3测试...${NC}"
run_iperf3_test | tee "$temp_file"
sed -i -e 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
sed -i -r '1,/\[ ID\] /d' "$temp_file"
sed -i '/^$/d' "$temp_file"
cp "$temp_file" "${output_file}_iperf3"
;;
# 回程路由
9)
8)
echo -e "运行${YELLOW}回程路由测试...${NC}"
if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项"
@ -473,20 +448,21 @@ run_script() {
generate_markdown_output() {
local base_output_file=$1
local temp_output_file="${base_output_file}.md"
local sections=("YABS" "Geekbench5" "融合怪" "IP质量" "流媒体" "响应" "多线程测速" "单线程测速" "iperf3" "回程路由")
local file_suffixes=("yabs" "gb5" "fusion" "ip_quality" "streaming" "response" "multi_thread" "single_thread" "iperf3" "route")
local sections=("YABS" "融合怪" "IP质量" "流媒体" "响应" "多线程测速" "单线程测速" "回程路由")
local file_suffixes=("yabs" "fusion" "ip_quality" "streaming" "response" "multi_thread" "single_thread" "route")
local empty_tabs=("去程路由" "Ping.pe" "哪吒 ICMP" "其他")
echo "[tabs]" > "$temp_output_file"
# 修改这里,添加 UTF-8 编码设置
echo "[tabs]" | iconv -f UTF-8 -t UTF-8//IGNORE > "$temp_output_file"
# 输出有内容的标签
for i in "${!sections[@]}"; do
section="${sections[$i]}"
suffix="${file_suffixes[$i]}"
if [ -f "${base_output_file}_${suffix}" ]; then
echo "[tab=\"$section\"]" >> "$temp_output_file"
echo "[tab=\"$section\"]" | iconv -f UTF-8 -t UTF-8//IGNORE >> "$temp_output_file"
echo "\`\`\`" >> "$temp_output_file"
cat "${base_output_file}_${suffix}" >> "$temp_output_file"
cat "${base_output_file}_${suffix}" | iconv -f UTF-8 -t UTF-8//IGNORE >> "$temp_output_file"
echo "\`\`\`" >> "$temp_output_file"
echo "[/tab]" >> "$temp_output_file"
rm "${base_output_file}_${suffix}"
@ -507,17 +483,17 @@ generate_markdown_output() {
local filename="${timestamp}${random_chars}.txt"
# 构造完整的URL
local url="${PASTE_SERVICE_URL}${filename}"
local url="http://nodeloc.uukk.de/test/${filename}"
# 上传文件
if curl -s -X PUT --data-binary @"$temp_output_file" "$url"; then
echo "测试结果已上传。您可以在以下链接查看:"
echo "$url"
echo "结果链接已保存到 $base_output_file.url"
echo "$url" > "$base_output_file.url"
else
echo "上传失败。结果已保存在本地文件 $temp_output_file"
fi
if curl -H "Content-Type: text/plain; charset=utf-8" -s -X PUT --data-binary @"$temp_output_file" "$url"; then
echo "测试结果已上传。您可以在以下链接查看:"
echo "$url"
echo "结果链接已保存到 $base_output_file.url"
echo "$url" > "$base_output_file.url"
else
echo "上传失败。结果已保存在本地文件 $temp_output_file"
fi
rm "$temp_output_file"
read -p "按回车键继续..."
@ -547,13 +523,12 @@ run_selected_scripts() {
echo "5. 响应测试"
echo "6. 多线程测试"
echo "7. 单线程测试"
echo "8. iperf3"
echo "9. 回程路由"
echo "8. 回程路由"
echo "0. 返回"
while true; do
read -p "请输入要执行的脚本编号用英文逗号分隔例如1,2,3):" script_numbers
if [[ "$script_numbers" =~ ^(0|10|[1-9])(,(0|10|[1-9]))*$ ]]; then
if [[ "$script_numbers" =~ ^(0|10|[1-8])(,(0|10|[1-8]))*$ ]]; then
break
else
echo -e "${RED}无效输入请输入0-9之间的数字用英文逗号分隔。${NC}"
@ -576,8 +551,7 @@ run_selected_scripts() {
# 主菜单
main_menu() {
echo -e "${GREEN}测试项目:${NC}Yabs融合怪IP质量流媒体解锁响应测试多线程测试"
echo " 单线程测试iperf3回程路由。"
echo -e "${GREEN}测试项目:${NC}Yabs融合怪IP质量流媒体解锁响应测试多线程测试单线程测试回程路由。"
echo -e "${YELLOW}1. 执行所有测试脚本${NC}"
echo -e "${YELLOW}2. 选择特定测试脚本${NC}"
echo -e "${YELLOW}0. 退出${NC}"

View File

@ -17,4 +17,7 @@
# 2024-08-13 v1.1.2 - 优化tab标签。
# 2024-08-19 v1.1.3 - 优化系统更新代码。
# 2024-08-28 v1.1.4 - 优化系统更新代码。
# 2024-09-07 v1.2.0 - 优化系统更新代码。
# 2024-09-07 v1.2.0 - 优化代码。
# 2024-09-07 v1.2.1 - 优化代码。
# 2024-09-07 v1.2.2 - 优化代码。
# 2024-09-07 v1.2.3 - 优化代码。