mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Update var names from setupVars.conf in gravity.sh
This commit is contained in:
parent
06aad4ec88
commit
60f13af1ce
1 changed files with 8 additions and 8 deletions
16
gravity.sh
16
gravity.sh
|
@ -44,7 +44,7 @@ else
|
|||
fi
|
||||
|
||||
#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
|
||||
basename=pihole
|
||||
|
@ -242,22 +242,22 @@ gravity_hostFormat() {
|
|||
# Format domain list as "192.168.x.x domain.com"
|
||||
echo "::: Formatting domains into a HOSTS file..."
|
||||
# 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
|
||||
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
|
||||
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
|
||||
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"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue