value1=ns1.abc.nl.
value2=ns2.abc.nl.
value3=ns3.abc.nl.
for domains in $(cat /home/carlito/Desktop/output.txt)
do
for nameserver in $(dig +short NS $domains)
do
if [[ ( $nameserver -eq $value1 ) || ( $nameserver -eq $value2 ) || ( $nameserve$
then
echo "$domains Namserver is local" >>/home/carlito/Desktop/resultaat.txt
break
else
echo "$domains namserver IS NOT local" >>/home/carlito/Desktop/resultaat.txt
fi
done
done
So i'm having trouble with the IF line of the script the error message=" nszero1.axc.nl.: syntax error: invalid arithmetic operator (error token is ".axc.nl."".
The purpose of this script= 'get output.txt (list of domains)' 'then dig +short NS $domains' and then check if its on my preferred name server $Value1,2,3 if true=good if false=bad
i already tried something like:
value="ns1.abc.nl./ns2.abc.nl/ns3.abc.nl."
for domains in $(cat /home/carlito/Desktop/output.txt)
do
if dig +short NS $domains == $value
then
echo "$domains is LOCAL"
else
echo"$domains Is NOT LOCAL"
fi
done
But what this does is if domain.nl=ns1.abc.nl./ns2.abc.nl it still echo's:Is NOT LOCAL. But i want the script to Echo=true if it has at least 1 of the values.
can some one point me in the right direction which function i should use and what am i doing wrong with the if line ?
thanks in advance