Closed livingfree2023 closed 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,其他代理需要用其他的变量控制。
祝好
原代码
且
handle_err
中未判断pause
值,会重复启动翻墙服务, 建议改为并且
handle_err
中加入if [ "$pause" = "true" ] ; then
的保护祝好