#!/bin/bash
#
# 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:
bitcoin -addnode=212.18.43.59 -addnode=82.181.125.210 -addnode=76.11.66.168 -addnode=129.186.116.7 -addnode=91.121.79.35 -addnode=109.169.46.223 -addnode=12.47.47.47 -noirc &