Commit 86db2005 authored by Thomas Tsiakalakis's avatar Thomas Tsiakalakis

Update gen.sh

parent a03699cd
......@@ -3,15 +3,21 @@
TMPFILE=$(tempfile)
TMPFILE_LIST=$(tempfile)
while read list; do
echo $list
echo "fetching ${list}..."
curl --connect-timeout 2 -s ${list} | grep -v '#' | rev | cut -d ' ' -f 1 | rev | grep '\.' | grep -v '0\.0\.0\.0' >> ${TMPFILE}
done < lists.txt
echo "$(wc -l ${TMPFILE}) lines"
echo "sorting..."
sort -u ${TMPFILE} > ${TMPFILE_LIST}
rm ${TMPFILE}
echo "$(wc -l ${TMPFILE_list}) lines"
echo "generating bind config..."
:> zones.blocked
while read line; do
echo 'zone "'${line}'" { type master; file "/etc/bind/db.blocklist"; };' >> zones.blocked
done < ${TMPFILE_LIST}
rm ${TMPFILE_LIST}
echo "done. "
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment