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}
|
piholeDir=/etc/${basename}
|
||||||
adList=${piholeDir}/gravity.list
|
adList=${piholeDir}/gravity.list
|
||||||
blacklist=${piholeDir}/blacklist.txt
|
blacklist=${piholeDir}/blacklist.txt
|
||||||
reload=true
|
reload=false
|
||||||
addmode=true
|
addmode=true
|
||||||
verbose=true
|
verbose=true
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ basename=pihole
|
||||||
piholeDir=/etc/${basename}
|
piholeDir=/etc/${basename}
|
||||||
adList=${piholeDir}/gravity.list
|
adList=${piholeDir}/gravity.list
|
||||||
whitelist=${piholeDir}/whitelist.txt
|
whitelist=${piholeDir}/whitelist.txt
|
||||||
reload=true
|
reload=false
|
||||||
addmode=true
|
addmode=true
|
||||||
verbose=true
|
verbose=true
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ AddDomain() {
|
||||||
if ${verbose}; then
|
if ${verbose}; then
|
||||||
echo -n "::: Adding $1 to $whitelist..."
|
echo -n "::: Adding $1 to $whitelist..."
|
||||||
fi
|
fi
|
||||||
|
reload=true
|
||||||
echo "$1" >> ${whitelist}
|
echo "$1" >> ${whitelist}
|
||||||
if ${verbose}; then
|
if ${verbose}; then
|
||||||
echo " done!"
|
echo " done!"
|
||||||
|
@ -99,6 +100,7 @@ RemoveDomain() {
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist}
|
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${whitelist}
|
||||||
|
reload=true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue