From 37e926ce843b13764c5dc87e7f90337b83dad858 Mon Sep 17 00:00:00 2001 From: rmceoin Date: Mon, 13 Jul 2015 09:28:45 -0700 Subject: [PATCH] Parses host only file formats now. Previously only handled hosts file format. Specifically, it can now handle the following list: 'http://mirror1.malwaredomains.com/files/justdomains' --- gravity.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 4734991a..635ddb95 100755 --- a/gravity.sh +++ b/gravity.sh @@ -69,7 +69,7 @@ do # Most of the lists downloaded are already in hosts file format but the spacing/formating is not contigious # This helps with that and makes it easier to read # It also helps with debugging so each stage of the script can be researched more in depth - echo "$data" | awk 'NF {if ($1 !~ "#") print $2}' > $saveLocation."$justDomainsExtension" + echo "$data" | awk 'NF {if ($1 !~ "#") { if (NF>1) {print $2} else {print $1}}}' > $saveLocation."$justDomainsExtension" else echo "Skipping $domain list because it does not have any new entries..." fi