diff --git "a/batch/CF\344\274\230\351\200\211IP-ANSI.bat" "b/batch/CF\344\274\230\351\200\211IP-ANSI.bat" index 18fe3e0..3c43ecd 100644 --- "a/batch/CF\344\274\230\351\200\211IP-ANSI.bat" +++ "b/batch/CF\344\274\230\351\200\211IP-ANSI.bat" @@ -151,8 +151,9 @@ mkdir rtt for /f "tokens=2 delims=:" %%i in ('find /c /v "" ip.txt') do ( set /a ipnum=%%i ) -if !tasknum! GTR !ipnum! set /a tasknum=ipnum -set /a iplist=ipnum/tasknum +if !tasknum! GTR !ipnum! set /a iplist=1 +set /a doubletasknum=tasknum*2 +if !ipnum! LSS !doubletasknum! (set /a iplist=2) else (set /a iplist=ipnum/tasknum) set /a a=1 set /a b=1 for /f "delims=" %%i in (ip.txt) do ( @@ -165,7 +166,7 @@ title RTT goto rtttest :rtttest -if !a! NEQ !b! (start /b RTT.bat !a!>nul&set /a a=a+1&goto rtttest) else (goto rttstatus) +if !a! NEQ !b! (start /b rtt.bat !a!>nul&set /a a=a+1&goto rtttest) else (goto rttstatus) :rttstatus timeout /T 2 /NOBREAK>nul diff --git "a/batch/CF\344\274\230\351\200\211IP-UTF8.bat" "b/batch/CF\344\274\230\351\200\211IP-UTF8.bat" index f99ea50..5124edb 100644 --- "a/batch/CF\344\274\230\351\200\211IP-UTF8.bat" +++ "b/batch/CF\344\274\230\351\200\211IP-UTF8.bat" @@ -151,8 +151,9 @@ mkdir rtt for /f "tokens=2 delims=:" %%i in ('find /c /v "" ip.txt') do ( set /a ipnum=%%i ) -if !tasknum! GTR !ipnum! set /a tasknum=ipnum -set /a iplist=ipnum/tasknum +if !tasknum! GTR !ipnum! set /a iplist=1 +set /a doubletasknum=tasknum*2 +if !ipnum! LSS !doubletasknum! (set /a iplist=2) else (set /a iplist=ipnum/tasknum) set /a a=1 set /a b=1 for /f "delims=" %%i in (ip.txt) do ( @@ -165,7 +166,7 @@ title RTT测试中 goto rtttest :rtttest -if !a! NEQ !b! (start /b RTT.bat !a!>nul&set /a a=a+1&goto rtttest) else (goto rttstatus) +if !a! NEQ !b! (start /b rtt.bat !a!>nul&set /a a=a+1&goto rtttest) else (goto rttstatus) :rttstatus timeout /T 2 /NOBREAK>nul diff --git a/shell/cf.sh b/shell/cf.sh index ddb4024..f974df4 100644 --- a/shell/cf.sh +++ b/shell/cf.sh @@ -224,11 +224,21 @@ do fi rm -rf meta.txt data.txt ipnum=$(cat anycast.txt | wc -l) + if [ $tasknum == 0 ] + then + tasknum=1 + fi if [ $ipnum -lt $tasknum ] then - tasknum=ipnum + iplist=1 + fi + doubletasknum=$[$tasknum*2] + if [ $ipnum -lt $doubletasknum ] + then + iplist=2 + else + iplist=ipnum/tasknum fi - iplist=ipnum/tasknum declare -i a=1 declare -i b=1 for i in `cat anycast.txt` @@ -261,7 +271,7 @@ do while true do sleep 2 - n=$(ls rtt | grep txt | grep -v "grep" | wc -l) + n=$(ls rtt | grep txt | wc -l) if [ $n -ne 0 ] then echo $(date +'%H:%M:%S') 等待RTT测试结束,剩余进程数 $n