mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-01 10:33:18 +00:00
Add back pi.hole and hostname
This commit is contained in:
parent
36c320859a
commit
898059f99b
1 changed files with 4 additions and 0 deletions
|
@ -238,9 +238,13 @@ function gravity_hostFormat() {
|
||||||
echo "::: Formatting domains into a HOSTS file..."
|
echo "::: Formatting domains into a HOSTS file..."
|
||||||
# If there is a value in the $piholeIPv6, then IPv6 will be used, so the awk command modified to create a line for both protocols
|
# If there is a value in the $piholeIPv6, then IPv6 will be used, so the awk command modified to create a line for both protocols
|
||||||
if [[ -n $piholeIPv6 ]];then
|
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
|
else
|
||||||
# Otherwise, just create gravity.list as normal using IPv4
|
# 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
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue