github.com/netdata/go.d.plugin@v0.58.1/modules/dnsmasq_dhcp/init.go (about)

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package dnsmasq_dhcp
     4  
     5  import "errors"
     6  
     7  func (d *DnsmasqDHCP) validateConfig() error {
     8  	if d.LeasesPath == "" {
     9  		return errors.New("empty 'leases_path'")
    10  	}
    11  	return nil
    12  }
    13  
    14  func (d *DnsmasqDHCP) checkLeasesPath() error {
    15  	f, err := openFile(d.LeasesPath)
    16  	if err != nil {
    17  		return err
    18  	}
    19  	_ = f.Close()
    20  	return nil
    21  }