diff --git a/back/lib/ips_to_peers_rxfr b/back/lib/ips_to_peers_rxfr index 75150ba..bf02c19 100755 --- a/back/lib/ips_to_peers_rxfr +++ b/back/lib/ips_to_peers_rxfr @@ -29,5 +29,12 @@ res="$("${LIB_DIR:?}/ns_lookup_rxfr")" || exit 4 # This should read from stdin while IFS= read -r line; do printf 'Checking line %s.\n' "${line}" - <<<"${res}" grep -B1 " ${line}" >>"${LOGFILE}" + pubkey="$(<<<"${line}" cut -d ' ' -f1)" + ips="$(<<<"${line}" cut -d ' ' -f2 | tr ' ' '\n')" + ipv4="$(<<<"${ips}" grep '\.')" + ipv6="$(<<<"${ips}" grep ':')" + ipv4="${ipv4%%/*}" + ipv6="${ipv6%%/*}" + <<<"${res}" grep -B1 " ${ipv4}" >>"${LOGFILE}" + <<<"${res}" grep -B1 " ${ipv6}" >>"${LOGFILE}" done