From 2c8e00a0d845e52cb96a210e3b3e35d02e5483c7 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Fri, 22 May 2020 10:55:23 -0500 Subject: [PATCH] Require validation and import only for push/pull --- gravity-sync.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/gravity-sync.sh b/gravity-sync.sh index 8cd4a3e..111bb56 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -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,13 +159,25 @@ case $# in case $1 in pull) echo -e "${GREEN}Success${NC}: Pull Requested" - pull_gs + 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" - push_gs + import_gs + + echo -e "${CYAN}Validating sync folder configuration${NC}" + validate_gs_folders + validate_ph_folders + + push_gs exit ;;