summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/dnsmasq_dhcp/init.go
blob: 6c74674a3f1811ef0c6f51f6cf73faf005637869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// SPDX-License-Identifier: GPL-3.0-or-later

package dnsmasq_dhcp

import "errors"

func (d *DnsmasqDHCP) validateConfig() error {
	if d.LeasesPath == "" {
		return errors.New("empty 'leases_path'")
	}
	return nil
}

func (d *DnsmasqDHCP) checkLeasesPath() error {
	f, err := openFile(d.LeasesPath)
	if err != nil {
		return err
	}
	_ = f.Close()
	return nil
}