From c97cfde9f991a9ddebb920d17ce015ef9f1f612f Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 21 Nov 2016 22:51:59 +0000 Subject: [PATCH] Update gravity.sh Only include domain part of lines that contain `/` e.g `www.fakenewswatch.com/megynkelly` --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index d05dddea..d9bd0521 100755 --- a/gravity.sh +++ b/gravity.sh @@ -289,7 +289,7 @@ gravity_advanced() { #awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' ${piholeDir}/${matterAndLight} | sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${piholeDir}/${supernova} #Above line does not correctly grab domains where comment is on the same line (e.g 'addomain.com #comment') #Add additional awk command to read all lines up to a '#', and then continue as we were - cat ${piholeDir}/${matterAndLight} | awk -F'#' '{print $1}' | awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' | sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${piholeDir}/${supernova} + cat ${piholeDir}/${matterAndLight} | awk -F'#' '{print $1}' | awk -F'/' '{print $1}' | awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' | sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${piholeDir}/${supernova} echo " done!" numberOf=$(wc -l < ${piholeDir}/${supernova})