mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
spacing
This commit is contained in:
parent
8cb72d87e4
commit
60d17b97f5
1 changed files with 6 additions and 6 deletions
12
gravity.sh
12
gravity.sh
|
@ -248,27 +248,27 @@ gravity_hostFormat() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check vars from setupVars.conf to see if we're using IPv4, IPv6, Or both.
|
# Check vars from setupVars.conf to see if we're using IPv4, IPv6, Or both.
|
||||||
if [[ -n "${IPv4_address}" && -n "${IPv6_address}" ]];then
|
if [[ -n "${IPv4_address}" && -n "${IPv6_address}" ]];then
|
||||||
|
|
||||||
# Both IPv4 and IPv6
|
# Both IPv4 and IPv6
|
||||||
echo -e "$IPv4_address $hostname\n$IPv6_address $hostname\n$IPv4_address pi.hole\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc}
|
echo -e "$IPv4_address $hostname\n$IPv6_address $hostname\n$IPv4_address pi.hole\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc}
|
||||||
cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc}
|
cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc}
|
||||||
|
|
||||||
elif [[ -n "${IPv4_address}" && -z "${IPv6_address}" ]];then
|
elif [[ -n "${IPv4_address}" && -z "${IPv6_address}" ]];then
|
||||||
|
|
||||||
# Only IPv4
|
# Only IPv4
|
||||||
echo -e "$IPv4addr $hostname\n$IPv4addr pi.hole" > ${piholeDir}/${accretionDisc}
|
echo -e "$IPv4addr $hostname\n$IPv4addr pi.hole" > ${piholeDir}/${accretionDisc}
|
||||||
cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc}
|
cat ${piholeDir}/${eventHorizon} | awk -v ipv4addr="$IPv4_address" '{sub(/\r$/,""); print ipv4addr" "$0}' >> ${piholeDir}/${accretionDisc}
|
||||||
|
|
||||||
elif [[ -z "${IPv4_address}" && -n "${IPv6_address}" ]];then
|
elif [[ -z "${IPv4_address}" && -n "${IPv6_address}" ]];then
|
||||||
|
|
||||||
# Only IPv6
|
# Only IPv6
|
||||||
echo -e "$IPv6_address $hostname\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc}
|
echo -e "$IPv6_address $hostname\n$IPv6_address pi.hole" > ${piholeDir}/${accretionDisc}
|
||||||
cat ${piholeDir}/${eventHorizon} | awk -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc}
|
cat ${piholeDir}/${eventHorizon} | awk -v ipv6addr="$IPv6_address" '{sub(/\r$/,""); print ipv6addr" "$0}' >> ${piholeDir}/${accretionDisc}
|
||||||
|
|
||||||
elif [[ -z "${IPv4_address}" && -z "${IPv6_address}" ]];then
|
elif [[ -z "${IPv4_address}" && -z "${IPv6_address}" ]];then
|
||||||
echo "::: No IP Values found! Please run 'pihole -r' and choose reconfigure to restore values"
|
echo "::: No IP Values found! Please run 'pihole -r' and choose reconfigure to restore values"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it
|
# Copy the file over as /etc/pihole/gravity.list so dnsmasq can use it
|
||||||
|
|
Loading…
Reference in a new issue