Only run VACUUM on "full" gravity runs

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2019-02-03 16:44:05 +01:00
parent 93f1859bab
commit fc62cf7e2f
No known key found for this signature in database
GPG key ID: FB60471F0575164A

View file

@ -39,6 +39,7 @@ VPNList="/etc/openvpn/ipp.txt"
piholeGitDir="/etc/.pihole"
gravityDBfile="${piholeDir}/gravity.db"
gravityDBschema="${piholeGitDir}/advanced/Templates/gravity.db.schema"
optimize_database=true
domainsExtension="domains"
matterAndLight="${basename}.0.matterandlight.txt"
@ -685,6 +686,7 @@ gravity_Cleanup() {
echo -e "${OVER} ${TICK} ${str}"
if ${optimize_database} ; then
str="Optimizing domains database"
echo -ne " ${INFO} ${str}..."
# Store
@ -697,6 +699,7 @@ gravity_Cleanup() {
else
echo -e "${OVER} ${TICK} ${str}"
fi
fi
# Only restart DNS service if offline
if ! pidof ${resolver} &> /dev/null; then
@ -726,9 +729,9 @@ for var in "$@"; do
"-f" | "--force" ) forceDelete=true;;
"-h" | "--help" ) helpFunc;;
"-sd" | "--skip-download" ) skipDownload=true;;
"-b" | "--blacklist-only" ) listType="blacklist";;
"-w" | "--whitelist-only" ) listType="whitelist";;
"-wild" | "--wildcard-only" ) listType="wildcard"; dnsRestartType="restart";;
"-b" | "--blacklist-only" ) listType="blacklist"; optimize_database=false;;
"-w" | "--whitelist-only" ) listType="whitelist"; optimize_database=false;;
"-wild" | "--wildcard-only" ) listType="wildcard"; optimize_database=false; dnsRestartType="restart";;
esac
done