Commit cf21d239 authored by SR's avatar SR
Browse files

Initial cleanup

parent d15666a9
......@@ -44,6 +44,7 @@ func main() {
c, err := routeros.Dial(*address, *username, *password)
if err != nil {
log.Println(err)
return
} else {
reply, err := c.Run("/ip/firewall/address-list/print", "?list="+*list, "=.proplist=.id,address")
if err != nil {
......@@ -56,6 +57,7 @@ func main() {
}
}
}
c.Close()
}
return
}
......@@ -67,13 +69,13 @@ func main() {
} else {
srcPath = "https://reestr.rublacklist.net/api/v2/ips/csv"
}
log.Println(srcPath)
for {
log.Println("Sync start")
c, err := routeros.Dial(*address, *username, *password)
if err != nil {
log.Println(err)
return
} else {
var ipl map[string]struct{}
if strings.HasPrefix(srcPath, "http://") || strings.HasPrefix(srcPath, "https://") {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment