- Add new whipstail to choose from example blocklists on new install

- remove adlists.default
- do not copy non-existent adlists.default on run of gravity

Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
Adam Warner
2018-04-17 09:50:25 +01:00
parent 557372b312
commit 88d4108f92
3 changed files with 39 additions and 28 deletions

View File

@@ -20,11 +20,9 @@ basename="pihole"
PIHOLE_COMMAND="/usr/local/bin/${basename}"
piholeDir="/etc/${basename}"
piholeRepo="/etc/.${basename}"
adListFile="${piholeDir}/adlists.list"
adListDefault="${piholeDir}/adlists.default"
adListRepoDefault="${piholeRepo}/adlists.default"
whitelistFile="${piholeDir}/whitelist.txt"
blacklistFile="${piholeDir}/blacklist.txt"
@@ -133,9 +131,7 @@ gravity_GetBlocklistUrls() {
# Determine if adlists file needs handling
if [[ ! -f "${adListFile}" ]]; then
# Create "adlists.list" by copying "adlists.default" from internal core repo
cp "${adListRepoDefault}" "${adListFile}" 2> /dev/null || \
echo -e " ${CROSS} Unable to copy ${adListFile##*/} from ${piholeRepo}"
echo -e " ${CROSS} No adlists file found. Nothing to do!"
elif [[ -f "${adListDefault}" ]] && [[ -f "${adListFile}" ]]; then
# Remove superceded $adListDefault file
rm "${adListDefault}" 2> /dev/null || \