#
# Checks addresses in addr.dat file
# by pinging and then connecting to Bitcoin port
#
FILE="addr.dat"
db4.6_dump "$FILE" | grep -o '........208d$' | sed 's/208d$//' | sort -u | sort -R |
while read LINE
do
if
IP="$(ping -c2 "0x$LINE" | head -1 | egrep -o '\([0-9]+.[0-9]+.[0-9]+.[0-9]+\)' | tr -d '(' | tr -d ')')"
then
# echo "$IP responds, checking for Bitcoin..."
if
OUTPUT="$(nmap -p 8333 "$IP"|grep open &>/dev/null)"
then
echo -n " -addnode=$IP"
fi
fi
done
And this is what I get at the moment: