mozerd has asked for the wisdom of the Perl Monks concerning the following question:
Salutations to All
Learning Perl and its a slow slog 4me so far
I have the following script that I use under Linux -- I would like to run the same script using pure Perl under Windows 10 via Strawberry Perl
#!/bin/sh saveTo=/var/www now=$(date); echo "# Generated by Joshaven Potter on $now" > $saveTo/dshield.rsc echo "/ip firewall address-list" >> $saveTo/dshield.rsc wget -q -O - http://feeds.dshield.org/block.txt | awk --posix '/^[0-9] +{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.0\t/ { print "add list=blacklist addre +ss=" $1 "/24 comment=DShield";}' >> $saveTo/dshield.rsc echo "# Generated by Joshaven Potter on $now" > $saveTo/spamhaus.rsc echo "/ip firewall address-list" >> $saveTo/spamhaus.rsc wget -q -O - http://www.spamhaus.org/drop/drop.lasso | awk --posix '/[ +0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\// { print "add list=bl +acklist address=" $1 " comment=SpamHaus";}' >> $saveTo/spamhaus.rsc echo "# Generated by Joshaven Potter on $now" > $saveTo/malc0de.rsc echo "/ip firewall address-list" >> $saveTo/malc0de.rsc wget -q -O - http://malc0de.com/bl/IP_Blacklist.txt | awk --posix '/^[ +0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ { print "add list=blac +klist address=" $1 " comment=malc0de";}' >> $saveTo/malc0de.rsc
Can a glorious Monk PLEASE convert this script to Perl?
Thank You
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Shell Script in Perl
by choroba (Cardinal) on Apr 05, 2018 at 14:51 UTC | |
by mozerd (Initiate) on Apr 05, 2018 at 18:05 UTC | |
Re: Shell Script in Perl
by marto (Cardinal) on Apr 05, 2018 at 14:46 UTC | |
Re: Shell Script in Perl
by wjw (Priest) on Apr 05, 2018 at 15:14 UTC |