From dc966eae84c770a76738a72d685460e74fd5da17 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Wed, 20 Apr 2016 20:58:34 -0400 Subject: [PATCH] Fix pi.hole and hostname from not being written --- gravity.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 7e18fc5d..decaf06a 100755 --- a/gravity.sh +++ b/gravity.sh @@ -240,12 +240,12 @@ function gravity_hostFormat() { if [[ -n $piholeIPv6 ]];then # 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 "127.0.0.1 $hostname\n::1 $hostname\n127.0.0.1 pi.hole\n::1 pi.hole" > $piholeDir/$accretionDisc - cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' > $piholeDir/$accretionDisc + cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $piholeDir/$accretionDisc 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 "127.0.0.1 $hostname\n127.0.0.1 pi.hole" > $piholeDir/$accretionDisc - cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' > $piholeDir/$accretionDisc + cat $piholeDir/$eventHorizon | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >> $piholeDir/$accretionDisc fi # Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it