multiple updates

This commit is contained in:
2023-12-09 14:21:28 -06:00
parent a11f92745d
commit 881c11b910
23 changed files with 721 additions and 433 deletions

View File

@ -1,13 +1,26 @@
package main
import (
"pihole-blocklist/bind/internal/config"
"time"
)
var cfg config.Config
func main() {
initialize()
cfg = config.Init()
// Set the zone serial number
cfg.ConfigFile.ZoneConfig.Serial = time.Now().In(cfg.TZLocal).Format("0601021504")
// get remote URL data
badDomains := getListData()
// clean-up
config.Config.ZoneConfig.BlockedDomains = cleanBadDomains(badDomains)
cfg.ConfigFile.ZoneConfig.BlockedDomains = cleanBadDomains(badDomains)
buildBindResponsePolicyFile()
// write file
if err := buildBindResponsePolicyFile(); err != nil {
cfg.Log.Error("unable to write file", "error", err, "path", cfg.BindOutputFileName)
}
}