mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Update blacklist.sh
This commit is contained in:
parent
10066209e7
commit
08e6f60941
1 changed files with 11 additions and 4 deletions
|
@ -42,12 +42,19 @@ verbose=true
|
||||||
domList=()
|
domList=()
|
||||||
domToRemoveList=()
|
domToRemoveList=()
|
||||||
|
|
||||||
|
piholeIPfile=/etc/pihole/piholeIP
|
||||||
piholeIPv6file=/etc/pihole/.useIPv6
|
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
|
if [[ -f $piholeIPfile ]];then
|
||||||
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
|
# If the file exists, it means it was exported from the installation script and we should use that value instead of detecting it in this script
|
||||||
piholeIPCIDR=$(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}')
|
piholeIP=$(cat $piholeIPfile)
|
||||||
piholeIP=${piholeIPCIDR%/*}
|
#rm $piholeIPfile
|
||||||
|
else
|
||||||
|
# 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%/*}
|
||||||
|
fi
|
||||||
|
|
||||||
modifyHost=false
|
modifyHost=false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue