diff --git a/CHANGELOG.md b/CHANGELOG.md index 888f972..62dafa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ A new function `./gravity-sync.sh backup` will now perform a sqlite operated bac By default, 7 days worth of backups will be retained in the `backup` folder. You can adjust the retention length by changing the `BACKUP_RETAIN` function in your `gravity-sync.conf` file. See the `ADVANCED.md` file for more information on setting these custom configuration options. +There are also enhancements to the `./gravity-sync.sh restore` function, where as previously this task would only restore the previous copy of the database that is made during sync operations, now this will ask you to select a previous backup copy (by date) and will use that file to restore. This will stop the Pi-hole services on the local server while the task is completed. You will now also be prompted to perform a push operation of the restored database to the primary Pi-hole server. + ## 2.0 ### The Smart Release diff --git a/gravity-sync.sh b/gravity-sync.sh index 2931326..0ef8f7b 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -662,8 +662,24 @@ function restore_gs { ${PIHOLE_BIN} restartdns reloadlists >/dev/null 2>&1 error_validate - logs_export - exit_withchange + + MESSAGE="Do you want to push the restored configuration to the primary Pi-hole? (yes/no)" + echo_need + read PUSH_TO_PRIMARY + + if [ "${PUSH_TO_PRIMARY}" == "Yes" ] || [ "${PUSH_TO_PRIMARY}" == "yes" ] || [ "${PUSH_TO_PRIMARY}" == "Y" ] || [ "${PUSH_TO_PRIMARY}" == "y" ] + then + push_gs + elif [ "${PUSH_TO_PRIMARY}" == "No" ] || [ "${PUSH_TO_PRIMARY}" == "no" ] || [ "${PUSH_TO_PRIMARY}" == "N" ] || [ "${PUSH_TO_PRIMARY}" == "n" ] + logs_export + exit_withchange + else + MESSAGE="Invalid Selection - Defaulting No" + echo_warn + + logs_export + exit_withchange + fi } # Logging Functions