mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-17 21:59:55 +00:00
flip reload logic. Do not reload if there are not changes made to blacklist.txt
This commit is contained in:
parent
bd0cc134bf
commit
7fb622638b
@ -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
|
||||
|
||||
@ -76,6 +76,7 @@ AddDomain() {
|
||||
echo -n "::: Adding $1 to blacklist file..."
|
||||
fi
|
||||
echo "$1" >> ${blacklist}
|
||||
reload=true
|
||||
echo " done!"
|
||||
else
|
||||
if ${verbose}; then
|
||||
@ -99,6 +100,7 @@ RemoveDomain() {
|
||||
echo "::: Un-blacklisting $dom..."
|
||||
fi
|
||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist}
|
||||
reload=true
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user