mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Run gravity upgrade on checkout/update
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
0066c6fbff
commit
8e8c7ecad2
@ -2225,6 +2225,11 @@ main() {
|
||||
# but before starting or restarting the ftl service
|
||||
disable_resolved_stublistener
|
||||
|
||||
# Check if gravity database needs to be upgraded. If so, do it without rebuilding
|
||||
# gravity altogether. This may be a very long running task needlessly blocking
|
||||
# the update process.
|
||||
/opt/pihole/gravity.sh --upgrade
|
||||
|
||||
printf " %b Restarting services...\\n" "${INFO}"
|
||||
# Start services
|
||||
|
||||
|
@ -78,7 +78,7 @@ gravity_build_tree() {
|
||||
echo -ne " ${INFO} ${str}..."
|
||||
|
||||
# The index is intentionally not UNIQUE as poor quality adlists may contain domains more than once
|
||||
output=$( { time pihole-FTL sqlite3 -ni "${gravityTEMPfile}" "CREATE INDEX idx_gravity ON gravity (domain, adlist_id);"; } )
|
||||
output=$( { pihole-FTL sqlite3 -ni "${gravityTEMPfile}" "CREATE INDEX idx_gravity ON gravity (domain, adlist_id);"; } 2>&1 )
|
||||
status="$?"
|
||||
|
||||
if [[ "${status}" -ne 0 ]]; then
|
||||
@ -831,6 +831,7 @@ for var in "$@"; do
|
||||
case "${var}" in
|
||||
"-f" | "--force" ) forceDelete=true;;
|
||||
"-r" | "--repair" ) repairSelector "$3";;
|
||||
"-u" | "--upgrade" ) upgrade_gravityDB "${gravityDBfile}" "${piholeDir}"; exit 0;;
|
||||
"-h" | "--help" ) helpFunc;;
|
||||
esac
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user