mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Require validation and import only for push/pull
This commit is contained in:
parent
eacefeeaa7
commit
2c8e00a0d8
@ -138,7 +138,7 @@ function validate_ph_folders {
|
|||||||
|
|
||||||
function validate_gs_arguments {
|
function validate_gs_arguments {
|
||||||
echo "Usage: $0 {pull|push}"
|
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 "> ${YELLOW}Push${NC} will force any changes made on this server to the primary"
|
||||||
echo -e "No changes have been made to the system"
|
echo -e "No changes have been made to the system"
|
||||||
exit 1
|
exit 1
|
||||||
@ -146,12 +146,6 @@ function validate_gs_arguments {
|
|||||||
|
|
||||||
# SCRIPT EXECUTION ###########################
|
# 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}"
|
echo -e "${CYAN}Evaluating $0 script arguments${NC}"
|
||||||
|
|
||||||
case $# in
|
case $# in
|
||||||
@ -165,13 +159,25 @@ case $# in
|
|||||||
case $1 in
|
case $1 in
|
||||||
pull)
|
pull)
|
||||||
echo -e "${GREEN}Success${NC}: Pull Requested"
|
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
|
exit
|
||||||
;;
|
;;
|
||||||
|
|
||||||
push)
|
push)
|
||||||
echo -e "${GREEN}Success${NC}: Push Requested"
|
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
|
exit
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user