mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Import settings function
This commit is contained in:
parent
9b60ea604a
commit
d3376947d5
@ -29,23 +29,23 @@ YELLOW='\033[0;93m'
|
|||||||
PURPLE='\033[0;95m'
|
PURPLE='\033[0;95m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
##############################################
|
|
||||||
|
|
||||||
# IMPORT SETTINGS
|
|
||||||
|
|
||||||
echo -e "${CYAN}Importing gravity-sync.conf settings${NC}"
|
|
||||||
if [ -f ~/${LOCAL_FOLDR}/gravity-sync.conf ]
|
|
||||||
then
|
|
||||||
source gravity-sync.conf
|
|
||||||
echo -e "${GREEN}Success${NC}: Configured for ${REMOTE_USER}@${REMOTE_HOST}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}Failure${NC}: Required file gravity-sync.conf is missing!"
|
|
||||||
echo -e "Please review installation documentation for more information"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FUNCTION DEFINITIONS #######################
|
# FUNCTION DEFINITIONS #######################
|
||||||
|
|
||||||
|
# Import Settings
|
||||||
|
|
||||||
|
function import_gs {
|
||||||
|
echo -e "${CYAN}Importing gravity-sync.conf settings${NC}"
|
||||||
|
if [ -f ~/${LOCAL_FOLDR}/gravity-sync.conf ]
|
||||||
|
then
|
||||||
|
source gravity-sync.conf
|
||||||
|
echo -e "${GREEN}Success${NC}: Configured for ${REMOTE_USER}@${REMOTE_HOST}"
|
||||||
|
else
|
||||||
|
echo -e "${RED}Failure${NC}: Required file gravity-sync.conf is missing!"
|
||||||
|
echo -e "Please review installation documentation for more information"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Update Function
|
# Update Function
|
||||||
|
|
||||||
function update_gs {
|
function update_gs {
|
||||||
@ -146,6 +146,8 @@ function validate_gs_arguments {
|
|||||||
|
|
||||||
# SCRIPT EXECUTION ###########################
|
# SCRIPT EXECUTION ###########################
|
||||||
|
|
||||||
|
import_gs
|
||||||
|
|
||||||
echo -e "${CYAN}Validating sync folder configuration${NC}"
|
echo -e "${CYAN}Validating sync folder configuration${NC}"
|
||||||
validate_gs_folders
|
validate_gs_folders
|
||||||
validate_ph_folders
|
validate_ph_folders
|
||||||
|
Loading…
Reference in New Issue
Block a user