2023-12-09 14:21:28 -06:00

27 lines
551 B
Go

package main
import (
"pihole-blocklist/bind/internal/config"
"time"
)
var cfg config.Config
func main() {
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
cfg.ConfigFile.ZoneConfig.BlockedDomains = cleanBadDomains(badDomains)
// write file
if err := buildBindResponsePolicyFile(); err != nil {
cfg.Log.Error("unable to write file", "error", err, "path", cfg.BindOutputFileName)
}
}