multiple updates
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user