From 30fe95c984577d25a65fa4051e0c7c783979b560 Mon Sep 17 00:00:00 2001 From: "Squ1dw@rd" Date: Fri, 29 Jul 2016 21:28:55 -0400 Subject: [PATCH] Add files via upload Add capability to specify add a number to the pi-hole host name to indicate the number of pi-hole boxes on the network ie pi1.hole Added capability to specify a different IP address in hosts file to allow for sending to a different server (a honey pot, etc.) --- gravity.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gravity.sh b/gravity.sh index 6278d80a..a55adc9a 100755 --- a/gravity.sh +++ b/gravity.sh @@ -27,6 +27,16 @@ else fi fi + +# If you are running more than one name server then +# Uncomment next then change number. +#piholeNSnumber=1 + +# If you want to send your response to another server then +# Uncomment next line to send query to a different ip address than pihole's ip +#piholeDumpAddress="0.0.0.0" + + piholeIPfile=/etc/pihole/piholeIP piholeIPv6file=/etc/pihole/.useIPv6 @@ -261,7 +271,8 @@ function gravity_hostFormat() { else # Otherwise, just create gravity.list as normal using IPv4 # Add hostname and dummy domain to the top of gravity.list to make ping result return a friendlier looking domain! Also allows for an easy way to access the Pi-hole admin console (pi.hole/admin) - echo -e "$piholeIP $hostname\n$piholeIP pi.hole" > $piholeDir/$accretionDisc + echo -e "$piholeIP $hostname\n$piholeIP pi$piholeNSnumber.hole" > $piholeDir/$accretionDisc + if ! [[ -n $piholeDumpAddress ]];then piholeDumpAddress="$piholeIP"; fi cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >> $piholeDir/$accretionDisc fi