From 70dadfba28f8f5862d0b3d8453bebae19656d0d9 Mon Sep 17 00:00:00 2001 From: Justin Theberge Date: Thu, 7 Apr 2016 21:52:47 -0400 Subject: [PATCH 1/3] add list options requested from issue#442 --- advanced/Scripts/blacklist.sh | 17 ++++++++++++++++- advanced/Scripts/whitelist.sh | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index fe6d42f3..11d13c5b 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -61,6 +61,7 @@ function helpFunc() echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" + echo "::: -l, --list Display your blacklisted domains" exit 1 } @@ -173,6 +174,19 @@ function Reload() { echo " done!" } +function DisplayBlist() { +clear +echo -e " Displaying Gravity Affected Domains \n" + +GRD="$blacklist" +count=1 +while IFS= read -r RD +do + echo "${count}: $RD" +count=$((count+1)) +done < "$blacklist" +} + ################################################### for var in "$@" @@ -182,7 +196,8 @@ do "-d" | "--delmode" ) addmode=false;; "-f" | "--force" ) force=true;; "-q" | "--quiet" ) versbose=false;; - "-h" | "--help" ) helpFunc;; + "-h" | "--help" ) helpFunc;; + "-l" | "--list" ) DisplayBlist;; * ) HandleOther "$var";; esac done diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index bf58b100..6ecb7715 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -60,6 +60,7 @@ function helpFunc() echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" + echo "::: -l, --list Display your whitelisted domains" exit 1 } @@ -186,6 +187,19 @@ function Reload() { echo " done!" } +function DisplayWlist() { +clear +echo -e " Displaying Gravity Resistant Domains \n" + +GRD="$whitelist" +count=1 +while IFS= read -r RD +do + echo "${count}: $RD" +count=$((count+1)) +done < "$whitelist" +} + ################################################### for var in "$@" @@ -195,7 +209,8 @@ do "-d" | "--delmode" ) addmode=false;; "-f" | "--force" ) force=true;; "-q" | "--quiet" ) versbose=false;; - "-h" | "--help" ) helpFunc;; + "-h" | "--help" ) helpFunc;; + "-l" | "--list" ) DisplayWlist;; * ) HandleOther "$var";; esac done From bdfc86f850175c75a575cb1dd08d6e52c4e4f89b Mon Sep 17 00:00:00 2001 From: Justin Theberge Date: Thu, 7 Apr 2016 21:58:57 -0400 Subject: [PATCH 2/3] fix formatting --- advanced/Scripts/blacklist.sh | 4 ++-- advanced/Scripts/whitelist.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index 11d13c5b..f06cd138 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -61,7 +61,7 @@ function helpFunc() echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" - echo "::: -l, --list Display your blacklisted domains" + echo "::: -l, --list Display your blacklisted domains" exit 1 } @@ -197,7 +197,7 @@ do "-f" | "--force" ) force=true;; "-q" | "--quiet" ) versbose=false;; "-h" | "--help" ) helpFunc;; - "-l" | "--list" ) DisplayBlist;; + "-l" | "--list" ) DisplayBlist;; * ) HandleOther "$var";; esac done diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index 6ecb7715..a19a175f 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -60,7 +60,7 @@ function helpFunc() echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" - echo "::: -l, --list Display your whitelisted domains" + echo "::: -l, --list Display your whitelisted domains" exit 1 } From 9a4c5cef8620e45ae5e31a66aad27c9d281e5827 Mon Sep 17 00:00:00 2001 From: Justin Theberge Date: Fri, 8 Apr 2016 10:14:17 -0400 Subject: [PATCH 3/3] fix indentations --- advanced/Scripts/blacklist.sh | 20 +++++++++----------- advanced/Scripts/whitelist.sh | 22 ++++++++++------------ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/advanced/Scripts/blacklist.sh b/advanced/Scripts/blacklist.sh index f06cd138..418b5a4c 100755 --- a/advanced/Scripts/blacklist.sh +++ b/advanced/Scripts/blacklist.sh @@ -61,7 +61,7 @@ function helpFunc() echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" - echo "::: -l, --list Display your blacklisted domains" + echo "::: -l, --list Display your blacklisted domains" exit 1 } @@ -175,16 +175,14 @@ function Reload() { } function DisplayBlist() { -clear -echo -e " Displaying Gravity Affected Domains \n" - -GRD="$blacklist" -count=1 -while IFS= read -r RD -do - echo "${count}: $RD" -count=$((count+1)) -done < "$blacklist" + clear + echo -e " Displaying Gravity Affected Domains \n" + count=1 + while IFS= read -r AD + do + echo "${count}: $AD" + count=$((count+1)) + done < "$blacklist" } ################################################### diff --git a/advanced/Scripts/whitelist.sh b/advanced/Scripts/whitelist.sh index a19a175f..ea9b33ad 100755 --- a/advanced/Scripts/whitelist.sh +++ b/advanced/Scripts/whitelist.sh @@ -60,7 +60,7 @@ function helpFunc() echo "::: -f, --force Force updating of the hosts files, even if there are no changes" echo "::: -q, --quiet output is less verbose" echo "::: -h, --help Show this help dialog" - echo "::: -l, --list Display your whitelisted domains" + echo "::: -l, --list Display your whitelisted domains" exit 1 } @@ -188,16 +188,14 @@ function Reload() { } function DisplayWlist() { -clear -echo -e " Displaying Gravity Resistant Domains \n" - -GRD="$whitelist" -count=1 -while IFS= read -r RD -do - echo "${count}: $RD" -count=$((count+1)) -done < "$whitelist" + clear + echo -e " Displaying Gravity Resistant Domains \n" + count=1 + while IFS= read -r RD + do + echo "${count}: $RD" + count=$((count+1)) + done < "$whitelist" } ################################################### @@ -209,7 +207,7 @@ do "-d" | "--delmode" ) addmode=false;; "-f" | "--force" ) force=true;; "-q" | "--quiet" ) versbose=false;; - "-h" | "--help" ) helpFunc;; + "-h" | "--help" ) helpFunc;; "-l" | "--list" ) DisplayWlist;; * ) HandleOther "$var";; esac