## Bu dosya ansible tarafindan yonetilmektedir!
## Burada yapilan degisikliklerin uzerine yazilir!!
{{ ansible_managed }}

#!/bin/bash

#URLS
IP_URL=https://zeustracker.abuse.ch/blocklist.php?download=ipblocklist
DOMAIN_URL=https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist

#OUTPUT FILES
IP_FILE={{ zeustracker['ipblocklist'] }}
DOMAIN_FILE={{ zeustracker['domainblocklist'] }}
OUTPUT=/dev/null

/usr/bin/wget $IP_URL -O $IP_FILE 2> $OUTPUT
EXIT=$?

if [ $EXIT != 0 ]
then
    /usr/bin/logger -p local5.notice "Downloading Zeus Ip Block List FAILED !!!"
    exit 0
else
    /usr/bin/logger -p local5.notice "Zeus Ip Block List Updated Succesfully..."
fi

/usr/bin/wget $DOMAIN_URL -O $DOMAIN_FILE 2> $OUTPUT
EXIT=$?

if [ $EXIT != 0 ]
then
    /usr/bin/logger -p local5.notice "Downloading Zeus Domain Block List FAILED !!!"
    exit 0
else
    /usr/bin/logger -p local5.notice "Zeus Domain Block List Updated Succesfully..."
fi
