mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-07 08:00:15 +00:00
uses a variable for hostname instead of raspberrypi
Some people use a hostname other than raspberrypi, so their hostname did not resolve to 127.0.0.1. I replaced that hardcoded value with a variable so that does not happen. I also added a few comments and minor formatting adjustments,.
This commit is contained in:
parent
a908dfdd28
commit
5c4bfb84b0
1 changed files with 4 additions and 5 deletions
|
@ -22,7 +22,6 @@ piholeDir=/etc/pihole
|
||||||
if [[ -f $piholeDir/pihole.conf ]];then
|
if [[ -f $piholeDir/pihole.conf ]];then
|
||||||
. $piholeDir/pihole.conf
|
. $piholeDir/pihole.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
justDomainsExtension=domains
|
justDomainsExtension=domains
|
||||||
matter=pihole.0.matter.txt
|
matter=pihole.0.matter.txt
|
||||||
andLight=pihole.1.andLight.txt
|
andLight=pihole.1.andLight.txt
|
||||||
|
@ -75,7 +74,7 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Find all files with the .domains extension and compile them into one file
|
# Find all files with the .domains extension and compile them into one file and remove CRs
|
||||||
echo "** Aggregating list of domains..."
|
echo "** Aggregating list of domains..."
|
||||||
find $origin/ -type f -name "*.$justDomainsExtension" -exec cat {} \; | tr -d '\r' > $origin/$matter
|
find $origin/ -type f -name "*.$justDomainsExtension" -exec cat {} \; | tr -d '\r' > $origin/$matter
|
||||||
|
|
||||||
|
@ -106,7 +105,7 @@ function gravity_advanced()
|
||||||
echo "::1 localhost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
echo "::1 localhost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
||||||
echo "255.255.255.255 broadcasthost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
echo "255.255.255.255 broadcasthost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
||||||
echo "127.0.0.1 localhost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
echo "127.0.0.1 localhost" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
||||||
echo "127.0.0.1 raspberrypi" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
echo "127.0.0.1 $(hostname)" | cat - $origin/$accretionDisc > $origin/latent.$accretionDisc && mv $origin/latent.$accretionDisc $origin/$accretionDisc
|
||||||
# Copy the file so dnsmasq can use it
|
# Copy the file so dnsmasq can use it
|
||||||
sudo cp $origin/$accretionDisc $adList
|
sudo cp $origin/$accretionDisc $adList
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue