mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-26 13:08:19 +00:00
Convert whitelist and blacklist to 0.0.0.0
This commit is contained in:
parent
b3376f1066
commit
615bb8f77b
2 changed files with 18 additions and 40 deletions
|
@ -27,12 +27,8 @@ versbose=true
|
|||
domList=()
|
||||
domToRemoveList=()
|
||||
|
||||
piholeIPv6file=/etc/pihole/.useIPv6
|
||||
|
||||
# Otherwise, the IP address can be taken directly from the machine, which will happen when the script is run by the user and not the installation script
|
||||
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
|
||||
piholeIPCIDR=$(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}')
|
||||
piholeIP=${piholeIPCIDR%/*}
|
||||
piholeIP="0.0.0.0"
|
||||
piholeIPv6="::"
|
||||
|
||||
modifyHost=false
|
||||
|
||||
|
@ -42,13 +38,6 @@ if [[ -r $piholeDir/pihole.conf ]];then
|
|||
. $piholeDir/pihole.conf
|
||||
fi
|
||||
|
||||
|
||||
if [[ -f $piholeIPv6file ]];then
|
||||
# If the file exists, then the user previously chose to use IPv6 in the automated installer
|
||||
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"
|
||||
|
|
|
@ -27,12 +27,8 @@ versbose=true
|
|||
domList=()
|
||||
domToRemoveList=()
|
||||
|
||||
piholeIPv6file=/etc/pihole/.useIPv6
|
||||
|
||||
# Otherwise, the IP address can be taken directly from the machine, which will happen when the script is run by the user and not the installation script
|
||||
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
|
||||
piholeIPCIDR=$(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}')
|
||||
piholeIP=${piholeIPCIDR%/*}
|
||||
piholeIP="0.0.0.0"
|
||||
piholeIPv6="::"
|
||||
|
||||
modifyHost=false
|
||||
|
||||
|
@ -42,12 +38,6 @@ if [[ -r $piholeDir/pihole.conf ]];then
|
|||
. $piholeDir/pihole.conf
|
||||
fi
|
||||
|
||||
if [[ -f $piholeIPv6file ]];then
|
||||
# If the file exists, then the user previously chose to use IPv6 in the automated installer
|
||||
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 whitelists one or more domains in the hosts file"
|
||||
|
@ -146,7 +136,6 @@ function ModifyHostFile(){
|
|||
mv $piholeDir/gravity.tmp $adList
|
||||
rm $piholeDir/whitelist.tmp
|
||||
echo " done!"
|
||||
|
||||
fi
|
||||
else
|
||||
#we need to add the removed domains to the hosts file
|
||||
|
|
Loading…
Add table
Reference in a new issue