mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Update var names from setupVars.conf in gravity.sh
This commit is contained in:
parent
edd00e8e70
commit
99057ed859
16
gravity.sh
16
gravity.sh
@ -44,7 +44,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#Remove the /* from the end of the IPv4addr.
|
#Remove the /* from the end of the IPv4addr.
|
||||||
IPv4_address=${IPv4_address%/*}
|
IPV4_ADDRESS=${IPV4_ADDRESS%/*}
|
||||||
|
|
||||||
# Variables for various stages of downloading and formatting the list
|
# Variables for various stages of downloading and formatting the list
|
||||||
basename=pihole
|
basename=pihole
|
||||||
@ -242,22 +242,22 @@ gravity_hostFormat() {
|
|||||||
# Format domain list as "192.168.x.x domain.com"
|
# Format domain list as "192.168.x.x domain.com"
|
||||||
echo "::: Formatting domains into a HOSTS file..."
|
echo "::: Formatting domains into a HOSTS file..."
|
||||||
# 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
|
||||||
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
|
||||||
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
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user