Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- curl -k --silent -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://hazard.mf.gov.pl/api/Register | \
- grep "AdresDomeny" | awk -F "<AdresDomeny>" '{print $2}' | \
- idn2 | awk -F "</adresdomeny>" '{print "zone \""$1"\" {type master; file \"/etc/bind/hazard.hosts\";};" }' > /tmp/hazard.zones
- /usr/sbin/named-checkzone /tmp/hazard.zones /etc/bind/hazard.hosts
- if [ $? -eq 0 ]
- then
- cp -u --preserve=mode,ownership /tmp/hazard.zones /etc/bind/hazard.zones
- /usr/sbin/rndc reload
- rm /tmp/hazard.zones
- else
- echo "ERROR hazard!"
- fi
- curl -sS http://malware-domains.com/files/spywaredomains.zones.zip > spywaredomains.zones.zip && unzip -o spywaredomains.zones.zip -d /tmp && rm spywaredomains.zones.zip
- cat /tmp/spywaredomains.zones | grep master > /tmp/spywaredomains2.zones
- /usr/sbin/named-checkzone /tmp/spywaredomains2.zones /etc/bind/blockeddomain.hosts
- if [ $? -eq 0 ]
- then
- cp -u --preserve=mode,ownership /tmp/spywaredomains2.zones /etc/bind/spywaredomains.zones
- /usr/sbin/rndc reload
- rm /tmp/spywaredomains.zones
- else
- echo "ERROR spywarezone!"
- fi
- curl -k --silent -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET https://hole.cert.pl/domains/domains.xml | \
- grep "AdresDomeny" | awk -F "<AdresDomeny>" '{print $2}' | \
- idn2 | awk -F "</adresdomeny>" '{print "zone \""$1"\" {type master; file \"/etc/bind/certplbh.hosts\";};" }' > /tmp/certplbh.zones
- /usr/sbin/named-checkzone /tmp/certplbh.zones /etc/bind/certplbh.hosts
- if [ $? -eq 0 ]
- then
- cp -u --preserve=mode,ownership /tmp/certplbh.zones /etc/bind/certplbh.zones
- /usr/sbin/rndc reload
- rm /tmp/certplbh.zones
- else
- echo "ERROR cert!"
- fi
Advertisement
Add Comment
Please, Sign In to add comment