mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-24 23:23:42 +00:00
Merge remote-tracking branch 'pi-hole/development' into development
This commit is contained in:
commit
c9e83c9419
2 changed files with 31 additions and 14 deletions
14
.pullapprove.yml
Normal file
14
.pullapprove.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
approve_by_comment: true
|
||||||
|
approve_regex: '^(Approved|:shipit:|:\+1:)'
|
||||||
|
reject_regex: '^(Rejected|:-1:)'
|
||||||
|
reset_on_push: true
|
||||||
|
author_approval: required
|
||||||
|
reviewers:
|
||||||
|
members:
|
||||||
|
- brantje
|
||||||
|
- dschaper
|
||||||
|
- jacobsalmela
|
||||||
|
- Mcat12
|
||||||
|
- PromoFaux
|
||||||
|
name: pullapprove
|
||||||
|
required: 3
|
|
@ -175,20 +175,23 @@ function ModifyHostFile(){
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Modifying HOSTS file to un-whitelist domains..."
|
echo "::: Modifying HOSTS file to un-whitelist domains..."
|
||||||
for rdom in "${domToRemoveList[@]}"
|
for rdom in "${domToRemoveList[@]}"
|
||||||
do
|
do
|
||||||
if [[ -n $piholeIPv6 ]];then
|
if grep -q "$rdom" /etc/pihole/*.domains; then
|
||||||
echo -n "::: Un-whitelisting $rdom on IPv4 and IPv6..."
|
echo "::: AdLists contain $rdom, re-adding block"
|
||||||
echo "$rdom" | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $adList
|
if [[ -n $piholeIPv6 ]];then
|
||||||
echo " done!"
|
echo -n "::: Restoring block for $rdom on IPv4 and IPv6..."
|
||||||
else
|
echo "$rdom" | awk -v ipv4addr="$piholeIP" -v ipv6addr="$piholeIPv6" '{sub(/\r$/,""); print ipv4addr" "$0"\n"ipv6addr" "$0}' >> $adList
|
||||||
echo -n "::: Un-whitelisting $rdom on IPv4"
|
echo " done!"
|
||||||
echo "$rdom" | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >>$adList
|
else
|
||||||
echo " done!"
|
echo -n "::: Restoring block for $rdom on IPv4..."
|
||||||
fi
|
echo "$rdom" | awk -v ipv4addr="$piholeIP" '{sub(/\r$/,""); print ipv4addr" "$0}' >>$adList
|
||||||
echo -n "::: Removing $rdom from $whitelist..."
|
echo " done!"
|
||||||
echo "$rdom" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' $whitelist
|
fi
|
||||||
echo " done!"
|
fi
|
||||||
done
|
echo -n "::: Removing $rdom from $whitelist..."
|
||||||
|
echo "$rdom" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' $whitelist
|
||||||
|
echo " done!"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue