mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-03-28 03:01:32 +00:00
Merge pull request #1682 from pi-hole/tweak/VPN_hostnames
Add VPN host names to local.list
This commit is contained in:
commit
17be6b860e
1 changed files with 8 additions and 2 deletions
10
gravity.sh
10
gravity.sh
|
@ -53,6 +53,7 @@ piholeDir=/etc/${basename}
|
||||||
adList=${piholeDir}/gravity.list
|
adList=${piholeDir}/gravity.list
|
||||||
blackList=${piholeDir}/black.list
|
blackList=${piholeDir}/black.list
|
||||||
localList=${piholeDir}/local.list
|
localList=${piholeDir}/local.list
|
||||||
|
VPNList=/etc/openvpn/ipp.txt
|
||||||
justDomainsExtension=domains
|
justDomainsExtension=domains
|
||||||
matterAndLight=${basename}.0.matterandlight.txt
|
matterAndLight=${basename}.0.matterandlight.txt
|
||||||
supernova=${basename}.1.supernova.txt
|
supernova=${basename}.1.supernova.txt
|
||||||
|
@ -217,7 +218,7 @@ gravity_Schwarzchild() {
|
||||||
# Find all active domains and compile them into one file and remove CRs
|
# Find all active domains and compile them into one file and remove CRs
|
||||||
local str="Aggregating list of domains"
|
local str="Aggregating list of domains"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
|
|
||||||
truncate -s 0 ${piholeDir}/${matterAndLight}
|
truncate -s 0 ${piholeDir}/${matterAndLight}
|
||||||
for i in "${activeDomains[@]}"; do
|
for i in "${activeDomains[@]}"; do
|
||||||
# Only assimilate list if it is available (download might have failed permanently)
|
# Only assimilate list if it is available (download might have failed permanently)
|
||||||
|
@ -337,6 +338,11 @@ gravity_hostFormatLocal() {
|
||||||
rm "${localList}"
|
rm "${localList}"
|
||||||
gravity_doHostFormat "${localList}.tmp" "${localList}"
|
gravity_doHostFormat "${localList}.tmp" "${localList}"
|
||||||
rm "${localList}.tmp"
|
rm "${localList}.tmp"
|
||||||
|
|
||||||
|
# Generate local HOSTS list with information obtained from OpenVPN (if available)
|
||||||
|
if [[ -f ${VPNList} ]]; then
|
||||||
|
awk -F, '{printf $2"\t"$1"\n"}' "${VPNList}" >> "${localList}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
gravity_hostFormatGravity() {
|
gravity_hostFormatGravity() {
|
||||||
|
@ -468,7 +474,7 @@ if [[ ! "${blackListOnly}" == true ]]; then
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
|
|
||||||
rm ${piholeDir}/pihole.*.txt 2> /dev/null
|
rm ${piholeDir}/pihole.*.txt 2> /dev/null
|
||||||
|
|
||||||
echo -e "${OVER} ${TICK} ${str}"
|
echo -e "${OVER} ${TICK} ${str}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue