From eef71f01ef50d8741e434df1553a29af6517978a Mon Sep 17 00:00:00 2001 From: borekon Date: Fri, 31 May 2024 07:36:30 +0000 Subject: [PATCH] Added option to specify the output filename --- domain_cleaner.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;