1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-05 15:39:46 +00:00

Merge pull request #447 from 7h3ju57/issue#442

Add list option to blacklist and whitelist
This commit is contained in:
Adam Warner 2016-04-08 20:07:24 +01:00
commit db2e9f8bf3
2 changed files with 28 additions and 2 deletions

View File

@ -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,17 @@ function Reload() {
echo " done!"
}
function DisplayBlist() {
clear
echo -e " Displaying Gravity Affected Domains \n"
count=1
while IFS= read -r AD
do
echo "${count}: $AD"
count=$((count+1))
done < "$blacklist"
}
###################################################
for var in "$@"
@ -183,6 +195,7 @@ do
"-f" | "--force" ) force=true;;
"-q" | "--quiet" ) versbose=false;;
"-h" | "--help" ) helpFunc;;
"-l" | "--list" ) DisplayBlist;;
* ) HandleOther "$var";;
esac
done

View File

@ -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,17 @@ function Reload() {
echo " done!"
}
function DisplayWlist() {
clear
echo -e " Displaying Gravity Resistant Domains \n"
count=1
while IFS= read -r RD
do
echo "${count}: $RD"
count=$((count+1))
done < "$whitelist"
}
###################################################
for var in "$@"
@ -196,6 +208,7 @@ do
"-f" | "--force" ) force=true;;
"-q" | "--quiet" ) versbose=false;;
"-h" | "--help" ) helpFunc;;
"-l" | "--list" ) DisplayWlist;;
* ) HandleOther "$var";;
esac
done