coolsnowwolf / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
309 stars 599 forks source link

Revert "fix: /etc/config/zero are incorrectly written to flash" #272

Closed arrio464 closed 4 months ago

arrio464 commented 4 months ago

Reverts coolsnowwolf/luci#269 https://github.com/coolsnowwolf/luci/commit/c0ab8ee0cf5e1f99075ae63bcec5298bef85830e https://github.com/coolsnowwolf/lede/issues/11974

错误地删除了所有的配置文件,导致重启后无法恢复连接。

arrio464 commented 4 months ago

原先的问题( https://github.com/immortalwrt/luci/issues/363 )依旧没有解决,但是我不太会整,等待下一个大佬来修

ghost commented 4 months ago

大佬们抽空merge一下吧

ghost commented 4 months ago

官方版本的代码里本来就有一个copy_config_path的参数可选,使能了就是复制config目录/etc/zerotier到/var/lib/zerotier-one,否则就是直接ln -s创建软链,这本来就是一个可以接受的使用方式,无非是官方的目录是/etc/zerotier,而lean的是/etc/config/zero。 如果要改就直接把官方版本这部分直接抄过来好了,我个人是认为zerotier这种东西,除非重启根本不会往flash写什么东西,没必要改。 那个issue里提到的大量写入flash我是不知道他是怎么观察到的。

        # ensure that the target exists
        mkdir -p $(dirname $path)

        if [ "$copy_config_path" = "1" ]; then
            cp -r $config_path $path
        else
            ln -s $config_path $path
        fi