Skip to content

Commit

Permalink
剥离CF Workers服务
Browse files Browse the repository at this point in the history
  • Loading branch information
badafans committed Feb 26, 2021
1 parent 517d01d commit 2514b2f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions linux/src/cf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ do
if [[ ! -f "$datafile" ]]
then
echo 获取CF节点IP
curl --retry 3 https://update.freecdn.workers.dev -o data.txt -#
curl --retry 3 https://update.udpfile.com -o data.txt -#
fi
domain=$(cat data.txt | grep domain= | cut -f 2- -d'=')
file=$(cat data.txt | grep file= | cut -f 2- -d'=')
Expand Down Expand Up @@ -273,14 +273,14 @@ done
start_seconds=$(date --date="$starttime" +%s)
end_seconds=$(date --date="$endtime" +%s)
clear
curl --ipv4 --resolve update.freecdn.workers.dev:443:$anycast --retry 3 -s -X POST -d '"CF-IP":"'$anycast'","Speed":"'$max'"' 'https://update.freecdn.workers.dev' -o temp.txt
curl --ipv4 --resolve update.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''$anycast-$max'' 'https://update.udpfile.com' -o temp.txt
publicip=$(cat temp.txt | grep publicip= | cut -f 2- -d'=')
colo=$(cat temp.txt | grep colo= | cut -f 2- -d'=')
url=$(cat temp.txt | grep url= | cut -f 2- -d'=')
url=$(cat temp.txt | grep url= | cut -f 2- -d'=')
app=$(cat temp.txt | grep app= | cut -f 2- -d'=')
databasenew=$(cat temp.txt | grep database= | cut -f 2- -d'=')
if [ "$app" != "20201208" ]
if [ "$app" != "20210226" ]
then
echo 发现新版本程序: $app
echo 更新地址: $url
Expand Down
6 changes: 3 additions & 3 deletions shell/cf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ do
if [[ ! -f "$datafile" ]]
then
echo 获取CF节点IP
curl --retry 3 https://update.freecdn.workers.dev -o data.txt -#
curl --retry 3 https://update.udpfile.com -o data.txt -#
fi
domain=$(cat data.txt | grep domain= | cut -f 2- -d'=')
file=$(cat data.txt | grep file= | cut -f 2- -d'=')
Expand Down Expand Up @@ -305,14 +305,14 @@ done
start_seconds=$(date --date="$starttime" +%s)
end_seconds=$(date --date="$endtime" +%s)
clear
curl --ipv4 --resolve update.freecdn.workers.dev:443:$anycast --retry 3 -s -X POST -d '"CF-IP":"'$anycast'","Speed":"'$max'"' 'https://update.freecdn.workers.dev' -o temp.txt
curl --ipv4 --resolve update.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''$anycast-$max'' 'https://update.udpfile.com' -o temp.txt
publicip=$(cat temp.txt | grep publicip= | cut -f 2- -d'=')
colo=$(cat temp.txt | grep colo= | cut -f 2- -d'=')
url=$(cat temp.txt | grep url= | cut -f 2- -d'=')
url=$(cat temp.txt | grep url= | cut -f 2- -d'=')
app=$(cat temp.txt | grep app= | cut -f 2- -d'=')
databasenew=$(cat temp.txt | grep database= | cut -f 2- -d'=')
if [ "$app" != "20201208" ]
if [ "$app" != "20210226" ]
then
echo 发现新版本程序: $app
echo 更新地址: $url
Expand Down
6 changes: 3 additions & 3 deletions windows/CF优选IP.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ goto start
del ip.txt CR.txt CRLF.txt cut.txt speed.txt temp.txt
RD /S /Q temp
cls
if not exist "data.txt" title 获取CF节点IP&curl --retry 3 https://update.freecdn.workers.dev -o data.txt -#
if not exist "data.txt" title 获取CF节点IP&curl --retry 3 https://update.udpfile.com -o data.txt -#
for /f "tokens=2 delims==" %%a in ('findstr /C:"domain" data.txt') do (
set domain=%%a
)
Expand Down Expand Up @@ -346,7 +346,7 @@ if %time:~6,1% EQU 0 (set /a stopS=%time:~7,1%) else (set /a stopS=%time:~6,2%)
set /a starttime=%startH%*3600+%startM%*60+%startS%
set /a stoptime=%stopH%*3600+%stopM%*60+%stopS%
if %starttime% GTR %stoptime% (set /a alltime=86400-%starttime%+%stoptime%) else (set /a alltime=%stoptime%-%starttime%)
curl --ipv4 --resolve update.freecdn.workers.dev:443:!anycast! --retry 3 -s -X POST -d """CF-IP"":""!anycast!"",""Speed"":""!Max!""" "https://update.freecdn.workers.dev" -o temp.txt
curl --ipv4 --resolve update.udpfile.com:443:!anycast! --retry 3 -s -X POST -d "!anycast!-!Max!" "https://update.udpfile.com" -o temp.txt
for /f "tokens=2 delims==" %%a in ('findstr /C:"publicip" temp.txt') do (
set publicip=%%a
)
Expand All @@ -358,7 +358,7 @@ set url=%%a
)
for /f "tokens=2 delims==" %%a in ('findstr /C:"app" temp.txt') do (
set app=%%a
if !app! NEQ 20201208 (echo 发现新版本程序: !app!&echo 更新地址: !url!&title 更新后才可以使用&echo 按任意键退出程序&pause>nul&exit)
if !app! NEQ 20210226 (echo 发现新版本程序: !app!&echo 更新地址: !url!&title 更新后才可以使用&echo 按任意键退出程序&pause>nul&exit)
)
for /f "tokens=2 delims==" %%a in ('findstr /C:"database" temp.txt') do (
set databasenew=%%a
Expand Down
2 changes: 1 addition & 1 deletion windows/Colo提取.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if %time:~3,1% EQU 0 (set /a startM=%time:~4,1%) else (set /a startM=%time:~3,2%
if %time:~6,1% EQU 0 (set /a startS=%time:~7,1%) else (set /a startS=%time:~6,2%)
set /a n=1
set /a m=1
for /f "skip=7" %%i in ('curl https://update.freecdn.workers.dev -#') do (
for /f "skip=7" %%i in ('curl https://update.udpfile.com -#') do (
set /a randomip=!random!%%256
echo url = "http://%%i!randomip!/cdn-cgi/trace">>temp/!m!.conf
set /a n+=1
Expand Down
2 changes: 1 addition & 1 deletion windows/单IP测速.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ color A
setlocal enabledelayedexpansion
cls
set /p a=ÇëÊäÈëÓÅÑ¡ IP :
curl --ipv4 --resolve update.freecdn.workers.dev:443:%a% https://update.freecdn.workers.dev -o temp.txt -#
curl --ipv4 --resolve update.udpfile.com:443:%a% https://update.udpfile.com -o temp.txt -#
for /f "tokens=2 delims==" %%a in ('findstr /C:"domain" temp.txt') do (
set domain=%%a
)
Expand Down

0 comments on commit 2514b2f

Please sign in to comment.