mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
all: make router setup/cleanup works more generally
This commit is contained in:
@@ -53,6 +53,9 @@ func (f *FreshTomato) PreRun() error {
|
||||
}
|
||||
|
||||
func (f *FreshTomato) Setup() error {
|
||||
if f.cfg.FirstListener().IsDirectDnsListener() {
|
||||
return nil
|
||||
}
|
||||
// Already setup.
|
||||
if val, _ := nvram.Run("get", nvram.CtrldSetupKey); val == "1" {
|
||||
return nil
|
||||
@@ -83,6 +86,9 @@ func (f *FreshTomato) Setup() error {
|
||||
}
|
||||
|
||||
func (f *FreshTomato) Cleanup() error {
|
||||
if f.cfg.FirstListener().IsDirectDnsListener() {
|
||||
return nil
|
||||
}
|
||||
if val, _ := nvram.Run("get", nvram.CtrldSetupKey); val == "1" {
|
||||
nvramKvMap["dnsmasq_custom"] = ""
|
||||
// Restore old configs.
|
||||
|
||||
Reference in New Issue
Block a user