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