gravity-sync/includes/gs-exit.sh
Michael Stanclift d97f92ccea
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 15:16:20 -05:00

64 lines
2.6 KiB
Bash

# GRAVITY SYNC BY VMSTAN #####################
# gs-exit.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!
## No Changes Made
function exit_nochange {
SCRIPT_END=$SECONDS
if [ "${TASKTYPE}" == "" ]
then
MESSAGE="${PROGRAM} ${UI_EXIT_ABORT} ${UI_EXIT_CALC_END}"
else
MESSAGE="${PROGRAM} ${TASKTYPE} ${UI_EXIT_ABORT} ${UI_EXIT_CALC_END}"
fi
echo_grav
exit 0
}
## Changes Made
function exit_withchange {
SCRIPT_END=$SECONDS
if [ "${TASKTYPE}" == "" ]
then
MESSAGE="${PROGRAM} ${UI_EXIT_COMPLETE} ${UI_EXIT_CALC_END}"
else
MESSAGE="${PROGRAM} ${TASKTYPE} ${UI_EXIT_COMPLETE} ${UI_EXIT_CALC_END}"
fi
echo_grav
exit 0
}
## List GS Arguments
function list_gs_arguments {
echo -e "Usage: $0 [options]"
echo -e "Example: '$0 pull'"
echo_lines
echo -e "Setup Options:"
echo -e " ${YELLOW}config${NC} Creates a new ${PROGRAM} configuration file"
echo -e " ${YELLOW}automate${NC} Schedules the ${PROGRAM} replication task using crontab"
echo -e " ${YELLOW}version${NC} Shows the installed version of ${PROGRAM} and check for updates"
echo -e " ${YELLOW}update${NC} Upgrades ${PROGRAM} to the latest available version using Git"
echo -e " ${YELLOW}dev${NC} Sets update command to use a development version of ${PROGRAM}"
echo -e " ${YELLOW}sudo${NC} Configures passwordless sudo for current user"
echo_blank
echo -e "Replication Options:"
echo -e " ${YELLOW}smart${NC} Detects Pi-hole changes on primary and secondary and then combines them"
echo -e " ${YELLOW}pull${NC} Brings the remote Pi-hole configuration to this server"
echo -e " ${YELLOW}push${NC} Sends the local Pi-hole configuration to the primary"
echo -e " ${YELLOW}compare${NC} Just checks for Pi-hole differences at each side without making changes"
echo -e " ${YELLOW}restore${NC} Restores the Pi-hole configuration on this server"
echo -e " ${YELLOW}backup${NC} Just backs up the Pi-hole on this server"
echo_blank
echo -e "Debug Options:"
echo -e " ${YELLOW}logs${NC} Shows the recent successful replication jobs/times"
echo -e " ${YELLOW}cron${NC} Displays the output of last crontab execution"
echo -e " ${YELLOW}info${NC} Shows information about the current configuration"
echo_lines
exit_nochange
}