The dshield part works but no rules are ever create for the spamhaus… I am running 3.23 and here is what I am running:
/tool fetch address=feeds.dshield.org host=feeds.dshield.org mode=http src-path=block.txt
/tool fetch address www.spamhaus.org host www.spamhaus.org mode http src-path drop/drop.lasso
:if ( [/file get [/file find name=block.txt] size] > 0 ) do={
/ip firewall address-list remove [/ip firewall address-list find list=dshield]
:global content [/file get [/file find name=block.txt] contents] ;
:global contentLen [ :len $content ] ;
:global lineEnd 0;
:global line “”;
:global 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={
:if ([:typeof [:toip [:pick $line 0 [:find $line “\t”] ] ] ] != “nil”) do={
:local pos1 [:find $line “\t” 0]
:local pos2 [:find $line “\t” $pos1]
:local pos3 [:find $line “\t” $pos2]
:log info ( "DShield Entry: " . [:pick $line 0 $pos1 ] . “/” . [:pick $line ($pos2+1) $pos3 ] )
/ip firewall address-list add list=dshield address=( [:pick $line 0 $pos1 ] . “/” . [:pick $line ($pos2+1) $pos3 ] )
}
}
} while ($lineEnd < $contentLen)
}
:if ( [/file get [/file find name=drop.lasso] size] > 0 ) do={
/ip firewall address-list remove [/ip firewall address-list find list=spamhaus.lasso]
:global content [/file get [/file find name=drop.lasso] contents] ;
:global contentLen [ :len $content ] ;
:global lineEnd 0;
:global line “”;
:global 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={
:if ([:len [:pick $line 0 [:find $line “;”] ] ] > 0 ) do={
:local pos1 [:find $line “;” 0]
:local entry [:pick $line 0 ($pos1-1) ]
:if ( [:len $entry ] > 0 ) do={
:log info “Lasso Entry: $entry”
/ip firewall address-list add list=spamhaus.lasso address=$entry
}
}
}
} while ($lineEnd < $contentLen)
}
If I run the command via command console I get this:
[admin@GATEWAY] /system script> run droplist
status: finished
status: finished
[admin@GATEWAY] /system script>
But no spamhaus rules…
If I run the command in winbox by clicking run it download and creates the drop files but neither dshield nor spamhause firewall rules and remove or created?