mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Improve error reporting
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
c1277705d8
commit
2664ac0efc
1 changed files with 6 additions and 5 deletions
11
gravity.sh
11
gravity.sh
|
@ -143,7 +143,12 @@ database_table_from_file() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete tmpfile
|
# Delete tmpfile
|
||||||
rm "$tmpFile" > /dev/null 2>&1 || true
|
rm "${tmpFile}" > /dev/null 2>&1 || \
|
||||||
|
echo -e " ${CROSS} Unable to remove ${tmpFile}"
|
||||||
|
|
||||||
|
# Delete source file
|
||||||
|
rm "${source}" 2> /dev/null || \
|
||||||
|
echo -e " ${CROSS} Unable to remove ${source}"
|
||||||
}
|
}
|
||||||
|
|
||||||
migrate_to_database() {
|
migrate_to_database() {
|
||||||
|
@ -152,22 +157,18 @@ ls -lh
|
||||||
if [[ -e "${whitelistFile}" ]]; then
|
if [[ -e "${whitelistFile}" ]]; then
|
||||||
# Store whitelisted domains in database
|
# Store whitelisted domains in database
|
||||||
database_table_from_file "whitelist" "${whitelistFile}"
|
database_table_from_file "whitelist" "${whitelistFile}"
|
||||||
rm "${whitelistFile}"
|
|
||||||
fi
|
fi
|
||||||
if [[ -e "${blacklistFile}" ]]; then
|
if [[ -e "${blacklistFile}" ]]; then
|
||||||
# Store blacklisted domains in database
|
# Store blacklisted domains in database
|
||||||
database_table_from_file "blacklist" "${blacklistFile}"
|
database_table_from_file "blacklist" "${blacklistFile}"
|
||||||
rm "${blacklistFile}"
|
|
||||||
fi
|
fi
|
||||||
if [[ -e "${regexFile}" ]]; then
|
if [[ -e "${regexFile}" ]]; then
|
||||||
# Store regex domains in database
|
# Store regex domains in database
|
||||||
database_table_from_file "regex" "${regexFile}"
|
database_table_from_file "regex" "${regexFile}"
|
||||||
rm "${regexFile}"
|
|
||||||
fi
|
fi
|
||||||
if [[ -e "${adListFile}" ]]; then
|
if [[ -e "${adListFile}" ]]; then
|
||||||
# Store adlists domains in database
|
# Store adlists domains in database
|
||||||
database_table_from_file "adlists" "${adListFile}"
|
database_table_from_file "adlists" "${adListFile}"
|
||||||
rm "${adListFile}"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue