mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 13:50:17 +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
1 changed files with 3 additions and 1 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
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ AddDomain() {
|
||||||
echo -n "::: Adding $1 to blacklist file..."
|
echo -n "::: Adding $1 to blacklist file..."
|
||||||
fi
|
fi
|
||||||
echo "$1" >> ${blacklist}
|
echo "$1" >> ${blacklist}
|
||||||
|
reload=true
|
||||||
echo " done!"
|
echo " done!"
|
||||||
else
|
else
|
||||||
if ${verbose}; then
|
if ${verbose}; then
|
||||||
|
@ -99,6 +100,7 @@ RemoveDomain() {
|
||||||
echo "::: Un-blacklisting $dom..."
|
echo "::: Un-blacklisting $dom..."
|
||||||
fi
|
fi
|
||||||
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist}
|
echo "$1" | sed 's/\./\\./g' | xargs -I {} perl -i -ne'print unless /'{}'(?!.)/;' ${blacklist}
|
||||||
|
reload=true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue