juewuy / ShellCrash

Run sing-box/mihomo as client in shell
8.73k stars 1.46k forks source link

关闭覆盖订阅配置的 hosts #243

Closed nauxliu closed 1 year ago

nauxliu commented 2 years ago

目前订阅文件中的 hosts 配置会被本地配置覆盖掉,有办法关闭这个行为吗?

juewuy commented 2 years ago

@nauxliu 会直接读取本机/etc/hosts文件

nauxliu commented 2 years ago

了解,但是我希望使用远端订阅的配置。这份配置我们使用 git 管理,自动生成的。我不太想在每台机器上去手动配置 hosts

juewuy commented 2 years ago

@nauxliu 那你只能改代码了

nauxliu commented 2 years ago

能指路一下大概动哪里吗? 读了一会儿代码还没有头绪。

juewuy commented 2 years ago

@nauxliu https://github.com/juewuy/ShellClash/blob/master/scripts/start.sh#L360-L360

nauxliu commented 2 years ago

感谢,我看到这一块代码了。但是好奇怎么改动能读取到原始配置中的 hosts,想要做一个 PR 维持原有 hosts 并和 /etc/hosts 合并。追了一下代码还是没思路,对 shell 不是太熟悉,望指教。

juewuy commented 2 years ago

@nauxliu 自定义配置文件7-7然后在config.yaml里添加