openwrt自动优选IP并同步到cloudflare
1.代码包下载
https://github.com/frankiejun/cvwt/releases/download/V1.0.2/openwrt.tar.gz
(目前版本是v1.0.2,看到有新的下载最新即可)
2.把压缩包传到openwrt并解压
tar -zcf openwrt.tar.gz
unzip openwrt.zip
3.执行预安装
sh cf_RE.sh
4.配置config.yaml
注意hostname(域名)和CCODE(国家代码)的位置要对应好。
检查yaml格式是否正确
https://www.yamllint.com/
如果缺yq则进入 https://github.com/mikefarah/yq/releases/
手动下载
chmod +x /usr/bin/yq
5.执行优选IP
chmod +x start.sh
./start.sh config.yaml
https://github.com/XIU2/CloudflareSpeedTest
CloudflareST 到这里下载最新
| Linux | ARM v8 | 64 位 | cfst_linux_arm64.tar.gz |
6.配置定时执行
crontab -e
按i开始编辑,按ESC键 准备输入命令 保存:wq 丢弃修改:q! 退出:q
注意黄色部分替换你脚本所在目录的全路径
0 3 * * * cd /git/cvwt/script/openwrt && ./start.sh ./config.yaml > a.log 2>&1 &
如果不需要日志:
0 3 * * * cd /git/cvwt/script/openwrt && ./start.sh ./config.yaml
cd /updateip/openwrt/ && ./start.sh ./config.yaml
cd /openwrt/ && ./start.sh ./config.yaml
cd /openwrt/openwrt/ && ./start.sh ./config.yaml
cd /opencfwrt/openwrt/ && ./start.sh ./config.yaml
0 3 * * * cd /openwrt/openwrt/ && ./start.sh ./config.yaml
相关视频:
Comments
Post a Comment