diff --git a/domain_cleaner.sh b/domain_cleaner.sh index 05ca697..55f4c01 100644 --- a/domain_cleaner.sh +++ b/domain_cleaner.sh @@ -1,19 +1,18 @@ #!/bin/bash source <(curl -s https://gitea.avc.cx/borekon/scripts/raw/branch/main/colores.sh) -ip_to_find="0.0.0.0" deleted=0 kept=0 domains=$(curl -s ${1:-https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts} | grep -v -e ^# -e localhost | cut -d" " -f2) +archivo=${2:-lista.txt} for j in $domains; do output=$(dig @192.168.1.1 $j +short) if [ -z "$output" ];then rojo "$j NXDOMAIN" - echo "" ((deleted++)) else echo $j\:$output - echo -e "0.0.0.0\t$j" >> lista.txt + echo -e "0.0.0.0\t$j" >> $archivo ((kept++)) fi done;