Removed logging, added output to user

master
Keith Irwin 2022-10-03 12:41:31 -06:00
parent 1a0d565183
commit fddcb2a7d4
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 7 additions and 8 deletions

View File

@ -37,12 +37,11 @@ while IFS= read -r line; do
ipv4="${ipv4%%/*}"
ipv6="${ipv6%%/*}"
domain=$(<<<"${res}" grep -B1 " ${ipv4}$" | sed '/--/d' | awk '{print $2}' | paste -d " " - - | awk '{print $1}')
printf '%s\t%s\t%s\t%s\n' "${domain}" "${ipv4}" "${ipv6}" "${pubkey}" >>"${LOGFILE}"
# case "${format}" in
# 'json') printf '{"domain":"%s","ipv4":"%s","ipv6":"%s","pubkey":"%s"},' \
# "${domain}" "${ipv4}" "${ipv6}" "${pubkey}" | tee -a "${LOGFILE}";;
# 'tsv') printf '%s\t%s\t%s\t%s\n' "${domain}" "${ipv4}" "${ipv6}" "${pubkey}" | tee -a "${LOGFILE}";;
# *) printf 'ERROR! Invalid format for %s: %s\n' "${0}" "${format}" >>"${LOGFILE}"
# exit 5;
# esac
case "${format}" in
'json') printf '{"domain":"%s","ipv4":"%s","ipv6":"%s","pubkey":"%s"},' \
"${domain}" "${ipv4}" "${ipv6}" "${pubkey}" | tee -a "${LOGFILE}";;
'tsv') printf '%s\t%s\t%s\t%s\n' "${domain}" "${ipv4}" "${ipv6}" "${pubkey}" | tee -a "${LOGFILE}";;
*) printf 'ERROR! Invalid format for %s: %s\n' "${0}" "${format}" >>"${LOGFILE}"
exit 5;
esac
done