mirror of
				https://github.com/vmstan/gravity-sync.git
				synced 2025-11-03 17:17:03 -05:00 
			
		
		
		
	* first! * folders * break out colors * home * seperate update * breakout pull * move file * breakout push * breakout smart * restore breakout * include restore * breakout logs validate ssh * breakout config exit intent * source exit * breakout backup automation and purge * breakout root * file headers * create push pull restore smart functions * consolidate options * include root check * includes * includes 2 * automate * rearrange imports * header * ssh rsync * new install steps * ticks * yellow * host check * check for git * ticks * check for pihole * check sudo powers * create sudo file * write output * pihole directory * install sudo file * purge error message * comment cleanup * installer * header * instructions * l * read p * header * skip prompts * sudo no longer in config * compare exit code * exit with change * 3.0 Co-authored-by: Michael Stanclift <vmstan@Sovereign.vmstan.net> Co-authored-by: Michael Stanclift <vmstan@Sovereign.local>
		
			
				
	
	
		
			48 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.8 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
 | 
						|
	MESSAGE="${PROGRAM} ${TASKTYPE} Aborting ($((SCRIPT_END-SCRIPT_START)) seconds)"
 | 
						|
	echo_info
 | 
						|
	exit 0
 | 
						|
}
 | 
						|
 | 
						|
## Changes Made
 | 
						|
function exit_withchange {
 | 
						|
	SCRIPT_END=$SECONDS
 | 
						|
	MESSAGE="${PROGRAM} ${TASKTYPE} Completed ($((SCRIPT_END-SCRIPT_START)) seconds)"
 | 
						|
	echo_info
 | 
						|
	exit 0
 | 
						|
}
 | 
						|
 | 
						|
## List GS Arguments
 | 
						|
function list_gs_arguments {
 | 
						|
	echo -e "Usage: $0 [options]"
 | 
						|
	echo -e "Example: '$0 pull'"
 | 
						|
	echo -e ""
 | 
						|
	echo -e "Setup Options:"
 | 
						|
	echo -e " ${YELLOW}config${NC}		Create a new ${CONFIG_FILE} file"
 | 
						|
	echo -e " ${YELLOW}automate${NC}	Add a scheduled pull task to crontab"
 | 
						|
	echo -e " ${YELLOW}update${NC}		Update ${PROGRAM} to the latest version"
 | 
						|
	echo -e " ${YELLOW}version${NC}	Display installed version of ${PROGRAM}"
 | 
						|
	echo -e " ${YELLOW}sudo${NC}		Configure passwordless sudo for current user"
 | 
						|
	echo -e ""
 | 
						|
	echo -e "Replication Options:"
 | 
						|
	echo -e " ${YELLOW}smart${NC}		Detect changes on each side and bring them together"
 | 
						|
	echo -e " ${YELLOW}pull${NC}		Force remote configuration changes to this server"
 | 
						|
	echo -e " ${YELLOW}push${NC}		Force local configuration made on this server back"
 | 
						|
	echo -e " ${YELLOW}restore${NC}	Restore the ${GRAVITY_FI} on this server"
 | 
						|
	echo -e " ${YELLOW}backup${NC}	Backup the ${GRAVITY_FI} on this server"
 | 
						|
	echo -e " ${YELLOW}compare${NC}	Just check for differences"
 | 
						|
	echo -e ""
 | 
						|
	echo -e "Debug Options:"
 | 
						|
	echo -e " ${YELLOW}logs${NC}		Show recent successful replication jobs"
 | 
						|
	echo -e " ${YELLOW}cron${NC}		Display output of last crontab execution"
 | 
						|
	echo -e ""
 | 
						|
	exit_nochange
 | 
						|
} |