1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-01-03 04:30:55 +00:00

Allow users to force recovery even when checks are okay using "pihole -g -r recover force"

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2021-09-11 21:56:44 +02:00
parent 469c179b32
commit ab4bce4787
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -858,7 +858,9 @@ database_recovery() {
echo -ne " ${INFO} ${str}..." echo -ne " ${INFO} ${str}..."
if result="$(pihole-FTL sqlite3 "${gravityDBfile}" "PRAGMA foreign_key_check" 2>&1)"; then if result="$(pihole-FTL sqlite3 "${gravityDBfile}" "PRAGMA foreign_key_check" 2>&1)"; then
echo -e "${OVER} ${TICK} ${str} - no errors found" echo -e "${OVER} ${TICK} ${str} - no errors found"
return if [[ $1 != "force" ]]; then
return
fi
else else
echo -e "${OVER} ${CROSS} ${str} - errors found:" echo -e "${OVER} ${CROSS} ${str} - errors found:"
while IFS= read -r line ; do echo " - $line"; done <<< "$result" while IFS= read -r line ; do echo " - $line"; done <<< "$result"
@ -942,7 +944,7 @@ if [[ "${recreate_database:-}" == true ]]; then
fi fi
if [[ "${recover_database:-}" == true ]]; then if [[ "${recover_database:-}" == true ]]; then
database_recovery database_recovery "$4"
fi fi
# Move possibly existing legacy files to the gravity database # Move possibly existing legacy files to the gravity database