Added option to specify the output filename
This commit is contained in:
parent
3c47ec2a74
commit
eef71f01ef
|
@ -1,19 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
source <(curl -s https://gitea.avc.cx/borekon/scripts/raw/branch/main/colores.sh)
|
source <(curl -s https://gitea.avc.cx/borekon/scripts/raw/branch/main/colores.sh)
|
||||||
|
|
||||||
ip_to_find="0.0.0.0"
|
|
||||||
deleted=0
|
deleted=0
|
||||||
kept=0
|
kept=0
|
||||||
domains=$(curl -s ${1:-https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts} | grep -v -e ^# -e localhost | cut -d" " -f2)
|
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
|
for j in $domains; do
|
||||||
output=$(dig @192.168.1.1 $j +short)
|
output=$(dig @192.168.1.1 $j +short)
|
||||||
if [ -z "$output" ];then
|
if [ -z "$output" ];then
|
||||||
rojo "$j NXDOMAIN"
|
rojo "$j NXDOMAIN"
|
||||||
echo ""
|
|
||||||
((deleted++))
|
((deleted++))
|
||||||
else
|
else
|
||||||
echo $j\:$output
|
echo $j\:$output
|
||||||
echo -e "0.0.0.0\t$j" >> lista.txt
|
echo -e "0.0.0.0\t$j" >> $archivo
|
||||||
((kept++))
|
((kept++))
|
||||||
fi
|
fi
|
||||||
done;
|
done;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user