mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Parse /etc/openvpn/ipp.txt (if existing) and add entries to local.list.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
d7d53849a3
commit
2624e56de5
10
gravity.sh
10
gravity.sh
@ -53,6 +53,7 @@ piholeDir=/etc/${basename}
|
||||
adList=${piholeDir}/gravity.list
|
||||
blackList=${piholeDir}/black.list
|
||||
localList=${piholeDir}/local.list
|
||||
VPNList=/etc/openvpn/ipp.txt
|
||||
justDomainsExtension=domains
|
||||
matterAndLight=${basename}.0.matterandlight.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
|
||||
local str="Aggregating list of domains"
|
||||
echo -ne " ${INFO} ${str}..."
|
||||
|
||||
|
||||
truncate -s 0 ${piholeDir}/${matterAndLight}
|
||||
for i in "${activeDomains[@]}"; do
|
||||
# Only assimilate list if it is available (download might have failed permanently)
|
||||
@ -337,6 +338,11 @@ gravity_hostFormatLocal() {
|
||||
rm "${localList}"
|
||||
gravity_doHostFormat "${localList}.tmp" "${localList}"
|
||||
rm "${localList}.tmp"
|
||||
|
||||
# Generate local HOSTS list with information obtained from OpenVPN (if available)
|
||||
if [[ -f ${VPNList} ]]; then
|
||||
awk -F, '{for (i=NF; i>=1; i-=2) printf $i"\t"$(i-1) "\n" }' "${VPNList}" >> "${localList}"
|
||||
fi
|
||||
}
|
||||
|
||||
gravity_hostFormatGravity() {
|
||||
@ -468,7 +474,7 @@ if [[ ! "${blackListOnly}" == true ]]; then
|
||||
echo -ne " ${INFO} ${str}..."
|
||||
|
||||
rm ${piholeDir}/pihole.*.txt 2> /dev/null
|
||||
|
||||
|
||||
echo -e "${OVER} ${TICK} ${str}"
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user