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:
DL6ER 2017-09-06 16:54:41 +02:00
parent d7d53849a3
commit 2624e56de5
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD

View file

@ -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
@ -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, '{for (i=NF; i>=1; i-=2) printf $i"\t"$(i-1) "\n" }' "${VPNList}" >> "${localList}"
fi
} }
gravity_hostFormatGravity() { gravity_hostFormatGravity() {