mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Flip reload logic. Do not reload lists if no changes made to whitelist.txt
This commit is contained in:
parent
b79392ba2c
commit
96053d13be
2 changed files with 4 additions and 2 deletions
|
@ -35,7 +35,7 @@ basename=pihole
|
|||
piholeDir=/etc/${basename}
|
||||
adList=${piholeDir}/gravity.list
|
||||
blacklist=${piholeDir}/blacklist.txt
|
||||
reload=true
|
||||
reload=false
|
||||
addmode=true
|
||||
verbose=true
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ basename=pihole
|
|||
piholeDir=/etc/${basename}
|
||||
adList=${piholeDir}/gravity.list
|
||||
whitelist=${piholeDir}/whitelist.txt
|
||||
reload=true
|
||||
reload=false
|
||||
addmode=true
|
||||
verbose=true
|
||||
|
||||
|
@ -77,6 +77,7 @@ AddDomain() {
|
|||
if ${verbose}; then
|
||||
echo -n "::: Adding $1 to $whitelist..."
|
||||
fi
|
||||
reload=true
|
||||
echo "$1" >> ${whitelist}
|
||||
if ${verbose}; then
|
||||
echo " done!"
|
||||
|
@ -99,6 +100,7 @@ RemoveDomain() {
|
|||
fi
|
||||
else
|
||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist}
|
||||
reload=true
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue