From 72a1fc3f6438f3346c382991a85275f52857433e Mon Sep 17 00:00:00 2001 From: Markus Napp Date: Wed, 1 Feb 2017 00:07:47 +0100 Subject: [PATCH 1/2] Fix output for wildcards in gravity.sh --- gravity.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gravity.sh b/gravity.sh index 31bc6bd0..c1938229 100755 --- a/gravity.sh +++ b/gravity.sh @@ -239,12 +239,12 @@ gravity_Blacklist() { gravity_Wildcard() { # Return number of wildcards in output - don't actually handle wildcards if [[ -f "${wildcardlist}" ]]; then - num=$(grep -c ^ "${wildcardlist}") + numWildcards=$(grep -c ^ "${wildcardlist}") if [[ -n "${IPV4_ADDRESS}" && -n "${IPV6_ADDRESS}" ]];then - let num/=2 + let numWildcards/=2 fi plural=; [[ "$num" != "1" ]] && plural=s - echo "::: Wildcard blocked domain${plural}: $numBlacklisted" + echo "::: Wildcard blocked domain${plural}: $numWildcards" else echo "::: No wildcards used!" fi From 66616eb0f05fa9cc775dea46d42f0ffd84093841 Mon Sep 17 00:00:00 2001 From: Markus Napp Date: Wed, 1 Feb 2017 19:55:33 +0100 Subject: [PATCH 2/2] Rename missing plurals check --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index c1938229..1c9da96a 100755 --- a/gravity.sh +++ b/gravity.sh @@ -243,7 +243,7 @@ gravity_Wildcard() { if [[ -n "${IPV4_ADDRESS}" && -n "${IPV6_ADDRESS}" ]];then let numWildcards/=2 fi - plural=; [[ "$num" != "1" ]] && plural=s + plural=; [[ "$numWildcards" != "1" ]] && plural=s echo "::: Wildcard blocked domain${plural}: $numWildcards" else echo "::: No wildcards used!"