#!/bin/bash touch pre-adblock.txt touch errors.log date=$(date '+%a, %d %b %Y %H:%M:%S %z') #Adblock lists download while read p; do echo "#!MARKER- Begin of $p" >> pre-adblock.txt wget -qO - $p >> pre-adblock.txt if [ $? -ne 0 ]; then echo "$date - Download failed: $p" >> errors.log fi sleep 2 done all-adblock.txt #Add own rules cat own-rules.txt >> all-adblock.txt #Remove duplicate lines awk '!seen[$0]++' pre-adblock.txt >> all-adblock.txt