Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /tool fetch address=bl.cp1251.com host=bl.cp1251.com mode=http src-path=/netc.txt
- :delay 2
- :local i 0
- :local cfn ""
- :local fn ""
- :global maxfiles 0
- :set maxfiles [/file get [/file find name=netc.txt] contents];
- /ip route rule remove [/ip route rule find table=gov.no]
- :while ($i < $maxfiles) do={
- :set cfn ("/net" . $i . ".txt")
- :set fn ("net" . $i . ".txt")
- /tool fetch address=bl.cp1251.com host=bl.cp1251.com mode=http src-path=$cfn
- :delay 2
- :if ( [/file get [/file find name=$fn] size] > 0 ) do={
- :local content [/file get [/file find name=$fn] contents] ;
- :local contentLen [ :len $content ] ;
- :local lineEnd 0;
- :local line "";
- :local lastEnd 0;
- :do {
- :set lineEnd [:find $content "\n" $lastEnd ] ;
- :set line [:pick $content $lastEnd $lineEnd] ;
- :set lastEnd ( $lineEnd + 1 ) ;
- :if ( [:pick $line 0 1] != "#" ) do={
- :local entry [:pick $line 0 $lineEnd ]
- :if ( [:len $entry ] > 0 ) do={
- /ip route rule add dst-address=$entry action=lookup-only-in-table table=gov.no
- }
- }
- } while ($lineEnd < $contentLen)
- }
- :set i ($i+1);
- }
Advertisement
Add Comment
Please, Sign In to add comment