From fddcb2a7d40ee771db5da93179b4435c9bb87f78 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Mon, 3 Oct 2022 12:41:31 -0600 Subject: [PATCH] Removed logging, added output to user --- back/lib/ips_to_peers_rxfr | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/back/lib/ips_to_peers_rxfr b/back/lib/ips_to_peers_rxfr index ed52a2c..b382b7d 100755 --- a/back/lib/ips_to_peers_rxfr +++ b/back/lib/ips_to_peers_rxfr @@ -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