1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

BIND: Warn if output directory does not exist. (#424)

This commit is contained in:
Tom Limoncelli
2018-12-10 14:05:01 -05:00
committed by GitHub
parent 4ef9e8bc40
commit 38074df158

View File

@@ -212,6 +212,11 @@ func (c *Bind) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correcti
// Read foundRecords:
foundRecords := make([]*models.RecordConfig, 0)
var oldSerial, newSerial uint32
if _, err := os.Stat(c.directory); os.IsNotExist(err) {
fmt.Printf("\nWARNING: BIND directory %q does not exist!\n", c.directory)
}
zonefile := filepath.Join(c.directory, strings.Replace(strings.ToLower(dc.Name), "/", "_", -1)+".zone")
foundFH, err := os.Open(zonefile)
zoneFileFound := err == nil