all: make router setup/cleanup works more generally

This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2023-08-09 23:54:23 +07:00
1 parent 66cb7cc21d
commit 9ed8e49a08
13 files changed
+115 -34

No files matched your search

+6
View File
@@ -44,6 +44,9 @@ func (s *Synology) PreRun() error {
}
func (s *Synology) Setup() error {
if s.cfg.FirstListener().IsDirectDnsListener() {
return nil
}
data, err := dnsmasq.ConfTmpl(dnsmasq.ConfigContentTmpl, s.cfg)
if err != nil {
return err
@@ -61,6 +64,9 @@ func (s *Synology) Setup() error {
}
func (s *Synology) Cleanup() error {
if s.cfg.FirstListener().IsDirectDnsListener() {
return nil
}
// Remove the custom config files.
for _, f := range []string{synologyDNSMasqConfigPath, synologyDhcpdInfoPath} {
if err := os.Remove(f); err != nil {