Require validation and import only for push/pull

This commit is contained in:
Michael Stanclift 2020-05-22 10:55:23 -05:00
parent eacefeeaa7
commit 2c8e00a0d8

View File

@ -138,7 +138,7 @@ function validate_ph_folders {
function validate_gs_arguments {
echo "Usage: $0 {pull|push}"
echo -e "> ${YELLOW}Pull${NC} will copy the ${GRAVITY_FI} configuration on $REMOTE_HOST to this server"
echo -e "> ${YELLOW}Pull${NC} will copy the ${GRAVITY_FI} configuration on a remote host to this server"
echo -e "> ${YELLOW}Push${NC} will force any changes made on this server to the primary"
echo -e "No changes have been made to the system"
exit 1
@ -146,12 +146,6 @@ function validate_gs_arguments {
# SCRIPT EXECUTION ###########################
import_gs
echo -e "${CYAN}Validating sync folder configuration${NC}"
validate_gs_folders
validate_ph_folders
echo -e "${CYAN}Evaluating $0 script arguments${NC}"
case $# in
@ -165,12 +159,24 @@ case $# in
case $1 in
pull)
echo -e "${GREEN}Success${NC}: Pull Requested"
import_gs
echo -e "${CYAN}Validating sync folder configuration${NC}"
validate_gs_folders
validate_ph_folders
pull_gs
exit
;;
push)
echo -e "${GREEN}Success${NC}: Push Requested"
import_gs
echo -e "${CYAN}Validating sync folder configuration${NC}"
validate_gs_folders
validate_ph_folders
push_gs
exit
;;