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
@@ -49,6 +49,9 @@ func (o *Openwrt) PreRun() error {
}
func (o *Openwrt) Setup() error {
if o.cfg.FirstListener().IsDirectDnsListener() {
return nil
}
data, err := dnsmasq.ConfTmpl(dnsmasq.ConfigContentTmpl, o.cfg)
if err != nil {
return err
@@ -68,6 +71,9 @@ func (o *Openwrt) Setup() error {
}
func (o *Openwrt) Cleanup() error {
if o.cfg.FirstListener().IsDirectDnsListener() {
return nil
}
// Remove the custom dnsmasq config
if err := os.Remove(openwrtDNSMasqConfigPath); err != nil {
return err