routeros_bogon_update
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
routeros_bogon_update [2015/04/19 11:45] – [RouterOS 6.x - Update bogon list automatically] admin | routeros_bogon_update [2015/04/19 12:02] – [RouterOS 6.x - Update bogon list automatically] admin | ||
---|---|---|---|
Line 14: | Line 14: | ||
/ip firewall address-list remove [/ip firewall address-list find list=bogons] | /ip firewall address-list remove [/ip firewall address-list find list=bogons] | ||
- | :local content [/file get [/file find name=bogon-bn-agg.txt] contents] ; | + | :global |
- | :local contentLen [:len $content]; | + | :global |
- | :local lineEnd 0; | + | :global |
- | :local line ""; | + | :global |
- | :local lastEnd 0; | + | :global |
:log info " | :log info " | ||
- | :while ($lineEnd < $contentLen) | + | :do { |
- | | + | |
- | :if ([:len $lineEnd] = 0) do={ | + | |
- | :set lineEnd $contentLen; | + | |
- | } | + | |
- | :set line [:pick $content $lastEnd $lineEnd]; | + | :local tmpArray [:toarray $line] ; |
- | | + | :if ( [: |
- | | + | :put $tmpArray; |
- | | + | /ip firewall address-list add name=bogons address=[: |
- | /ip firewall address-list add list=bogons address="$line" | + | } |
- | | + | } while ($lineEnd < $contentLen)</ |
- | }</ | + | |
* Test run script:< | * Test run script:< | ||
* Schedule script:< | * Schedule script:< | ||
routeros_bogon_update.txt · Last modified: 2021/10/31 14:40 by admin