|
|
|
@ -25,6 +25,22 @@ else
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
function helpFunc()
|
|
|
|
|
{
|
|
|
|
|
echo "::: Immediately blacklists one or more domains in the hosts file"
|
|
|
|
|
echo ":::"
|
|
|
|
|
echo ":::"
|
|
|
|
|
echo "::: Usage: pihole -b domain1 [domain2 ...]"
|
|
|
|
|
echo "::: Options:"
|
|
|
|
|
echo "::: -d, --delmode Remove domains from the blacklist"
|
|
|
|
|
echo "::: -nr, --noreload Update blacklist without refreshing dnsmasq"
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [[ $# = 0 ]]; then
|
|
|
|
|
helpFunc
|
|
|
|
|
fi
|
|
|
|
@ -70,27 +86,6 @@ if [[ -f $piholeIPv6file ]];then
|
|
|
|
|
piholeIPv6=$(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }')
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function helpFunc()
|
|
|
|
|
{
|
|
|
|
|
echo "::: Immediately blacklists one or more domains in the hosts file"
|
|
|
|
|
echo ":::"
|
|
|
|
|
echo ":::"
|
|
|
|
|
echo "::: Usage: pihole -b domain1 [domain2 ...]"
|
|
|
|
|
echo "::: Options:"
|
|
|
|
|
echo "::: -d, --delmode Remove domains from the blacklist"
|
|
|
|
|
echo "::: -nr, --noreload Update blacklist without refreshing dnsmasq"
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [[ $# = 0 ]]; then
|
|
|
|
|
helpFunc
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
function HandleOther(){
|
|
|
|
|
#check validity of domain
|
|
|
|
|
validDomain=$(echo "$1" | perl -ne'print if /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/')
|
|
|
|
|