Added line parsing
parent
6811948344
commit
69bfb044f5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue