Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SR
gotiklist
Commits
cf21d239
Commit
cf21d239
authored
Oct 20, 2018
by
SR
Browse files
Initial cleanup
parent
d15666a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.go
View file @
cf21d239
...
...
@@ -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://"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment