Merge pull request #1982 from LudovicRousseau/master

Create blacklist.txt if not existant
This commit is contained in:
Mark Drobnak 2018-02-18 15:32:01 -05:00 committed by GitHub
commit f14184df30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,9 +10,9 @@
# Globals # Globals
basename=pihole basename=pihole
piholeDir=/etc/${basename} piholeDir=/etc/"${basename}"
whitelist=${piholeDir}/whitelist.txt whitelist="${piholeDir}"/whitelist.txt
blacklist=${piholeDir}/blacklist.txt blacklist="${piholeDir}"/blacklist.txt
readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf" readonly wildcardlist="/etc/dnsmasq.d/03-pihole-wildcard.conf"
reload=false reload=false
addmode=true addmode=true
@ -80,8 +80,13 @@ HandleOther() {
PoplistFile() { PoplistFile() {
# Check whitelist file exists, and if not, create it # Check whitelist file exists, and if not, create it
if [[ ! -f ${whitelist} ]]; then if [[ ! -f "${whitelist}" ]]; then
touch ${whitelist} touch "${whitelist}"
fi
# Check blacklist file exists, and if not, create it
if [[ ! -f "${blacklist}" ]]; then
touch "${blacklist}"
fi fi
for dom in "${domList[@]}"; do for dom in "${domList[@]}"; do