This commit is contained in:
Dan Ballard 2020-09-28 16:36:31 -07:00
parent a432c70c0a
commit 7ca5f77545
1 changed files with 6 additions and 1 deletions

View File

@ -59,13 +59,18 @@ func main() {
func load() {
_, err := os.Stat(blocklistFile)
if os.IsNotExist(err) {
log.Warnf("No blocklistFile: %V\n", err)
return
}
bytes, err := ioutil.ReadFile(blocklistFile)
if err != nil {
log.Errorf("Couldn't read blocklist file: %v\n", err)
return
}
json.Unmarshal(bytes, blocklistedIps)
err = json.Unmarshal(bytes, &blocklistedIps)
if err != nil {
log.Errorf("Couldn't unmarshal blocklisted IPs: %v\n", err)
}
return
}