From f40b7d98129d0a6f11e64e940191e736ae6d7f9f Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 25 Oct 2019 06:18:25 +0200 Subject: [PATCH] firewall_pleroma_rejects.sh: Only return IP if no error occured. --- firewall_pleroma_rejects.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firewall_pleroma_rejects.sh b/firewall_pleroma_rejects.sh index ece56ab..3ffc4ca 100755 --- a/firewall_pleroma_rejects.sh +++ b/firewall_pleroma_rejects.sh @@ -4,7 +4,7 @@ # BE CAREFUL: Some instances may run under a shared IP, you may block more than # you want. Watch out for timeouts in the logs. No warranties and so on. -# Version: 2019-10-09_1 +# Version: 2019-10-25_1 # You can modify the ignore-list in # "${XDG_CONFIG_HOME}/firewall_pleroma_rejects/ignorelist.user", @@ -45,7 +45,7 @@ function get_ips() # Outputs IPs, separated by newline. for ip_version in AAAA A; do for ip in $(dig +short "${domain}" "${ip_version}"); do - echo "${ip}" + [[ "${?}" -eq 0 ]] && echo "${ip}" done done }