gravity-sync/includes/gs-restore.sh

250 lines
7.7 KiB
Bash
Raw Normal View History

# GRAVITY SYNC BY VMSTAN #####################
# gs-restore.sh ##############################
# For documentation or downloading updates visit https://github.com/vmstan/gravity-sync
# This code is called from the main gravity-sync.sh file and should not execute directly!
## Restore Task
function task_restore {
TASKTYPE='RESTORE'
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${MESSAGE}: ${TASKTYPE}"
echo_good
2020-12-31 02:49:54 +00:00
show_target
validate_gs_folders
validate_ph_folders
if [ "${INCLUDE_CNAME}" == "1" ]
then
validate_dns_folders
fi
validate_sqlite3
2020-12-31 02:49:54 +00:00
restore_gs
exit
}
## Restore Gravity
function restore_gs {
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE=""
2020-12-31 02:45:47 +00:00
echo_warn
2020-12-31 02:49:54 +00:00
GRAVITY_DATE_LIST=$(ls ${LOCAL_FOLDR}/${BACKUP_FOLD} | grep $(date +%Y) | grep ${GRAVITY_FI} | colrm 18)
2020-12-31 02:49:54 +00:00
if [ "${GRAVITY_DATE_LIST}" != "" ]
2020-12-31 02:45:47 +00:00
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_WARNING}"
2020-12-31 02:45:47 +00:00
echo_info
2020-12-31 02:49:54 +00:00
echo_lines
ls ${LOCAL_FOLDR}/${BACKUP_FOLD} | grep $(date +%Y) | grep ${GRAVITY_FI} | colrm 18
echo -e "IGNORE-GRAVITY"
echo_lines
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SELECT_DATE} ${UI_GRAVITY_NAME}"
echo_need
read INPUT_BACKUP_DATE
if [ "$INPUT_BACKUP_DATE" == "IGNORE-GRAVITY" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SKIPPING} ${UI_GRAVITY_NAME}"
echo_warn
elif [ -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_BACKUP_DATE}-${GRAVITY_FI}.backup ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_GRAVITY_NAME} ${UI_RESTORE_BACKUP_SELECTED}"
echo_good
DO_GRAVITY_RESTORE='1'
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_INVALID}"
echo_info
exit_nochange
fi
2020-12-31 02:45:47 +00:00
fi
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
if [ "$SKIP_CUSTOM" != '1' ]
then
if [ -f ${PIHOLE_DIR}/${CUSTOM_DNS} ]
then
CUSTOM_DATE_LIST=$(ls ${LOCAL_FOLDR}/${BACKUP_FOLD} | grep $(date +%Y) | grep ${CUSTOM_DNS} | colrm 18)
2020-12-31 02:49:54 +00:00
if [ "${CUSTOM_DATE_LIST}" != "" ]
2020-12-31 02:45:47 +00:00
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
# MESSAGE="${UI_RESTORE_SELECT_DATE} ${UI_CUSTOM_NAME}"
# echo_info
2020-12-31 02:49:54 +00:00
echo_lines
ls ${LOCAL_FOLDR}/${BACKUP_FOLD} | grep $(date +%Y) | grep ${CUSTOM_DNS} | colrm 18
echo -e "IGNORE-CUSTOM"
echo_lines
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SELECT_DATE} ${UI_CUSTOM_NAME}"
echo_need
read INPUT_DNSBACKUP_DATE
if [ "$INPUT_DNSBACKUP_DATE" == "IGNORE-CUSTOM" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SKIPPING} ${UI_CUSTOM_NAME}"
echo_warn
elif [ -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_DNSBACKUP_DATE}-${CUSTOM_DNS}.backup ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CUSTOM_NAME} ${UI_RESTORE_BACKUP_SELECTED}"
echo_good
DO_CUSTOM_RESTORE='1'
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_INVALID}"
echo_fail
exit_nochange
fi
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CUSTOM_NAME} ${UI_RESTORE_BACKUP_UNAVAILABLE}"
echo_info
2020-12-31 02:45:47 +00:00
fi
fi
fi
2020-12-31 02:49:54 +00:00
if [ "$INCLUDE_CNAME" == '1' ]
then
if [ -f ${DNSMAQ_DIR}/${CNAME_CONF} ]
then
CNAME_DATE_LIST=$(ls ${LOCAL_FOLDR}/${BACKUP_FOLD} | grep $(date +%Y) | grep ${CNAME_CONF} | colrm 18)
if [ "${CNAME_DATE_LIST}" != "" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
# MESSAGE="${UI_RESTORE_SELECT_DATE} ${UI_CNAME_NAME}"
# echo_info
echo_lines
ls ${LOCAL_FOLDR}/${BACKUP_FOLD} | grep $(date +%Y) | grep ${CNAME_CONF} | colrm 18
echo -e "IGNORE-CNAME"
echo_lines
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SELECT_DATE} ${UI_CNAME_NAME}"
echo_need
read INPUT_CNAMEBACKUP_DATE
if [ "$INPUT_CNAMEBACKUP_DATE" == "IGNORE-CNAME" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SKIPPING} ${UI_CNAME_NAME}"
echo_warn
elif [ -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_CNAMEBACKUP_DATE}-${CNAME_CONF}.backup ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CNAME_NAME} ${UI_RESTORE_BACKUP_SELECTED}"
echo_good
DO_CNAME_RESTORE='1'
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_INVALID}"
echo_fail
exit_nochange
fi
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CNAME_NAME} ${UI_RESTORE_BACKUP_UNAVAILABLE}"
echo_info
fi
fi
fi
if [ "$DO_GRAVITY_RESTORE" == "1" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_GRAVITY_NAME} ${UI_RESTORE_FROM} ${INPUT_BACKUP_DATE}"
echo_info
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_GRAVITY_NAME} ${UI_RESTORE_BACKUP_UNAVAILABLE}"
echo_info
fi
if [ "$DO_CUSTOM_RESTORE" == "1" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CUSTOM_NAME} ${UI_RESTORE_FROM} ${INPUT_DNSBACKUP_DATE}"
echo_info
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CUSTOM_NAME} ${UI_RESTORE_BACKUP_UNAVAILABLE}"
echo_info
fi
if [ "$DO_CNAME_RESTORE" == "1" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CNAME_NAME} ${UI_RESTORE_FROM} ${INPUT_CNAMEBACKUP_DATE}"
echo_info
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_CNAME_NAME} ${UI_RESTORE_BACKUP_UNAVAILABLE}"
echo_info
fi
2020-12-31 02:45:47 +00:00
intent_validate
2020-12-31 02:49:54 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_TIME_TRAVEL}"
2020-12-31 02:45:47 +00:00
echo_info
2020-12-31 02:49:54 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
# MESSAGE="Stopping FTLDNS services on $HOSTNAME"
# echo_stat
2020-12-31 02:49:54 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
# ${PH_EXEC} stop >/dev/null 2>&1
# error_validate
2020-12-31 02:49:54 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
if [ "$DO_GRAVITY_RESTORE" == "1" ]
2020-12-31 02:49:54 +00:00
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SECONDARY} ${UI_GRAVITY_NAME}"
2020-12-31 02:49:54 +00:00
echo_stat
sudo cp ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_BACKUP_DATE}-${GRAVITY_FI}.backup ${PIHOLE_DIR}/${GRAVITY_FI} >/dev/null 2>&1
2020-12-31 02:49:54 +00:00
error_validate
2020-12-31 02:45:47 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
validate_gravity_permissions
2020-12-31 02:49:54 +00:00
fi
if [ "$DO_CUSTOM_RESTORE" == '1' ]
2020-12-31 02:49:54 +00:00
then
2020-12-31 02:45:47 +00:00
if [ -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_DNSBACKUP_DATE}-${CUSTOM_DNS}.backup ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SECONDARY} ${UI_CUSTOM_NAME}"
2020-12-31 02:45:47 +00:00
echo_stat
2020-12-31 02:49:54 +00:00
sudo cp ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_DNSBACKUP_DATE}-${CUSTOM_DNS}.backup ${PIHOLE_DIR}/${CUSTOM_DNS} >/dev/null 2>&1
error_validate
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
validate_custom_permissions
2020-12-31 02:45:47 +00:00
fi
fi
2020-12-31 02:49:54 +00:00
if [ "$DO_CNAME_RESTORE" == '1' ]
then
if [ -f ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_CNAMEBACKUP_DATE}-${CNAME_CONF}.backup ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_SECONDARY} ${UI_CNAME_NAME}"
echo_stat
sudo cp ${LOCAL_FOLDR}/${BACKUP_FOLD}/${INPUT_CNAMEBACKUP_DATE}-${CNAME_CONF}.backup ${DNSMAQ_DIR}/${CNAME_CONF} >/dev/null 2>&1
error_validate
validate_cname_permissions
fi
fi
2020-12-31 02:45:47 +00:00
pull_gs_reload
2020-12-31 02:49:54 +00:00
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_PUSH_PROMPT}"
2020-12-31 02:45:47 +00:00
echo_need
read PUSH_TO_PRIMARY
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
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" ]
then
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_RESTORE_PUSH_NOPUSH}"
echo_info
2020-12-31 02:45:47 +00:00
logs_export
exit_withchange
else
3.3.3 is 3.4.0 (#185) * new first line of script * no requested * Abort! * Test silent folder validation * sameline * echo newline * echo_sameline * what happened? * sameline for ssh * sqlite sameline * Lower case * Reset line * clear line * Flip the line * version update * Backup lowercase * More lowercase * Remove file names from standard messages * Breakout backup message * Output backup folder size * Just H * Invalid replication settings * Compare updated * Colors and updates * Lower case for version output * For Pihole * Cron cleanup * Sudo, or no sudo. * Branch! * Silent error validate * Silent error validate * Clearing up status messages * Records * Primary and secondary * Gravity database * Domain Database * Backup output cleanup * Move file permission validation into new functions * Change restart * UI variables test * Breakout UI variables into new file * Unified validation functions * Replace text strings with variables * Replace text strings with variables * Replace logging with variables * Convert backup to UI variables * Switch restore to UI variables * Fix bug where gravity database did not restore * App validation checks * Rev to 3.4.0 * Convert Push functions to new strings * Completing push UI changes * remove added line * Move purge to UI strings * Move automation to UI strings * Move core strings into UI * Exit strings * First pass at hashing UI * Escape the remote system query (#179) * hashing committed Co-authored-by: Michael Stanclift <vmstan@mstanclift-a03.local> Co-authored-by: Veduco <59983694+Veduco@users.noreply.github.com>
2021-04-01 20:16:20 +00:00
MESSAGE="${UI_INVALID_SELECTION} - ${UI_RESTORE_PUSH_NOPUSH}"
2020-12-31 02:45:47 +00:00
echo_warn
2020-12-31 02:49:54 +00:00
2020-12-31 02:45:47 +00:00
logs_export
exit_withchange
fi
}