gravity-sync/includes/gs-core.sh
Michael Stanclift 7d09218524
3.0.2 (#104)
* version change

* Nova

* No-config function

* Markdown cleanup

* Create gs-core file

* correct missing includes via cron

Co-authored-by: Michael Stanclift <vmstan@Sovereign.vmstan.net>
Co-authored-by: Michael Stanclift <vmstan@sovereign.local>
2020-10-10 11:30:40 -05:00

71 lines
1.2 KiB
Bash

# GRAVITY SYNC BY VMSTAN #####################
# gs-core.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!
## Import Settings
function import_gs {
MESSAGE="Importing ${CONFIG_FILE} Settings"
echo -en "${STAT} $MESSAGE"
if [ -f $HOME/${LOCAL_FOLDR}/${CONFIG_FILE} ]
then
source $HOME/${LOCAL_FOLDR}/${CONFIG_FILE}
error_validate
# MESSAGE="Targeting ${REMOTE_USER}@${REMOTE_HOST}"
# echo_info
# detect_ssh
else
echo_fail
MESSAGE="${CONFIG_FILE} Missing"
echo_info
TASKTYPE='CONFIG'
config_generate
fi
}
## Invalid Tasks
function task_invalid {
echo_fail
list_gs_arguments
}
## Error Validation
function error_validate {
if [ "$?" != "0" ]
then
echo_fail
exit 1
else
echo_good
fi
}
# Standard Output
function start_gs {
MESSAGE="${PROGRAM} ${VERSION} Executing"
echo_info
import_gs
MESSAGE="Evaluating Arguments"
echo_stat
if [ "${ROOT_CHECK_AVOID}" != "1" ]
then
root_check
fi
}
# Standard Output No Config
function start_gs_noconfig {
MESSAGE="${PROGRAM} ${VERSION} Executing"
echo_info
MESSAGE="Evaluating Arguments"
echo_stat
}