all: make router setup/cleanup works more generally

This commit is contained in:
Cuong Manh Le
2023-08-09 23:54:23 +07:00
committed by Cuong Manh Le
parent 66cb7cc21d
commit 9ed8e49a08
13 changed files with 115 additions and 34 deletions
+6
View File
@@ -47,6 +47,9 @@ func (u *Ubios) PreRun() error {
}
func (u *Ubios) Setup() error {
if u.cfg.FirstListener().IsDirectDnsListener() {
return nil
}
data, err := dnsmasq.ConfTmpl(dnsmasq.ConfigContentTmpl, u.cfg)
if err != nil {
return err
@@ -62,6 +65,9 @@ func (u *Ubios) Setup() error {
}
func (u *Ubios) Cleanup() error {
if u.cfg.FirstListener().IsDirectDnsListener() {
return nil
}
// Remove the custom dnsmasq config
if err := os.Remove(ubiosDNSMasqConfigPath); err != nil {
return err