frankiejun / cvwt

Cloudflare 上建workers和pages节点及自动化优选IP的一揽子工具
https://github.com/frankiejun/cvwt
GNU General Public License v3.0
114 stars 100 forks source link

pause=false时会重复start翻墙软件 #6

Closed livingfree2023 closed 3 months ago

livingfree2023 commented 4 months ago

原代码

trap handle_err EXIT

handle_err中未判断pause值,会重复启动翻墙服务, 建议改为

trap handle_err HUP INT TERM

并且handle_err中加入if [ "$pause" = "true" ] ; then的保护

祝好

frankiejun commented 3 months ago

嗯,谢谢建议,后面我改一下。

livingfree2023 commented 3 months ago

不过我觉得 https://github.com/mingxiaoyu/luci-app-cloudflarespeedtest 这个luci的程序,在测速期间,通过uci set的方式把passwall运行模式改成gfw模式是个很好的方法,因为有的时候测速时间可能很长(10分钟以上?),强行关掉服务有可能造成不便。

可惜上述这个项目目前不兼容最新的passwall了,但是我读了一下里面核心代码就是通过

uci set "passwall.@global[0].tcp_proxy_mode"='direct'
uci commit

来关掉默认转发,然后通过

uci set "passwall.@global[0].tcp_proxy_mode"='proxy'
uci commit

来再打开默认转发。 当然也可以把原来的用户设置保存在变量中,结束后恢复即可。

当然这些代码只针对passwall,其他代理需要用其他的变量控制。

祝好