run_selected_scripts

This commit is contained in:
James 2025-01-21 11:10:57 +08:00
parent db71552652
commit a1aa7daa99

View File

@ -500,7 +500,6 @@ run_all_scripts() {
clear
}
# 执行选定的脚本
run_selected_scripts() {
clear
local base_output_file="NLvps_results_$(date +%Y%m%d_%H%M%S)"
@ -515,7 +514,7 @@ run_selected_scripts() {
echo "0. 返回"
while true; do
read -p "请输入要执行的脚本编号用英文逗号分隔例如1,2,3):" script_numbers < /dev/tty
read -p "请输入要执行的脚本编号用英文逗号分隔例如1,2,3):" script_numbers < /dev/tty
if [[ "$script_numbers" =~ ^(0|10|[1-7])(,(0|10|[1-7]))*$ ]]; then
break
else
@ -523,20 +522,26 @@ run_selected_scripts() {
fi
done
IFS=',' read -ra selected_scripts <<< "$script_numbers"
echo "开始执行选定的测试脚本..."
if [ "$script_numbers" == "0" ]; then
if [[ "$script_numbers" == "0" ]]; then
clear
show_welcome
else
for number in "${selected_scripts[@]}"; do
clear
run_script "$number" "$base_output_file"
done
generate_markdown_output "$base_output_file"
return # 确保退出函数,不再继续执行
fi
# 分割用户输入为数组
IFS=',' read -ra selected_scripts <<< "$script_numbers"
echo "开始执行选定的测试脚本..."
for number in "${selected_scripts[@]}"; do
clear
run_script "$number" "$base_output_file"
done
# 所有脚本执行完毕后生成 Markdown 输出
generate_markdown_output "$base_output_file"
}
# 主菜单
main_menu() {
echo -e "${GREEN}测试项目:${NC}YabsIP质量流媒体解锁响应测试多线程测试单线程测试回程路由。"