mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
all: make router setup/cleanup works more generally
This commit is contained in:
committed by
Cuong Manh Le
parent
66cb7cc21d
commit
9ed8e49a08
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user