improve performace?
This commit is contained in:
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
"gitlab.smoothnet.org/nhyatt/bind-response-policy-zone-creator/internal/config"
|
||||
@ -21,6 +22,15 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// test allow regex
|
||||
for _, allowedItem := range cfg.ConfigFile.AllowLists {
|
||||
_, err := regexp.Compile(allowedItem)
|
||||
if err != nil {
|
||||
log.Error("unable to parse allow list item", "error", err, "regex", allowedItem)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// Set the zone serial number
|
||||
cfg.ConfigFile.ZoneConfig.Serial = time.Now().In(cfg.TZLocal).Format("0601021504")
|
||||
|
||||
|
Reference in New Issue
Block a user