BestCDN/run_cpp.sh
2025-07-26 12:59:57 +08:00

56 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# BestCDN C++ Runner Script
echo "BestCDN C++ High-Performance Tester"
echo "==================================="
# Check if C++ tester is built
if [ ! -f "src/cpp/bestcdn_tester" ]; then
echo "C++ tester not found. Building..."
chmod +x build_cpp.sh
./build_cpp.sh
if [ $? -ne 0 ]; then
echo "Build failed. Exiting."
exit 1
fi
fi
# Check if IP lists exist
missing_files=()
for provider in cloudflare fastly edgeone esa; do
if [ ! -f "ip_lists/${provider}.txt" ]; then
missing_files+=("ip_lists/${provider}.txt")
fi
done
if [ ${#missing_files[@]} -gt 0 ]; then
echo "Warning: Missing IP list files:"
for file in "${missing_files[@]}"; do
echo " - $file"
done
echo ""
echo "Please add your IP lists to the ip_lists/ directory before running."
echo "Each file should contain one IP per line."
echo ""
read -p "Continue anyway? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Create results directory
mkdir -p results
# Run the C++ tester
echo "Starting high-performance C++ tester..."
echo ""
cd src/cpp
./bestcdn_tester
echo ""
echo "C++ testing completed!"
echo "Check the results/ directory for output files."