mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Update gravity-sync.sh
This commit is contained in:
parent
b3df6fcbe4
commit
fe38ec3cd7
@ -34,6 +34,12 @@ YELLOW='\033[0;93m'
|
|||||||
PURPLE='\033[0;95m'
|
PURPLE='\033[0;95m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
|
# Message Codes
|
||||||
|
FAIL="[${RED}FAIL${NC}]"
|
||||||
|
WARN="[${PURPLE}WARN${NC}]"
|
||||||
|
GOOD="[${GREEN}GOOD${NC}]"
|
||||||
|
STAT="[${CYAN}STAT${NC}]"
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
### DO NOT CHANGE ANYTHING BELOW THIS LINE ###
|
### DO NOT CHANGE ANYTHING BELOW THIS LINE ###
|
||||||
##############################################
|
##############################################
|
||||||
@ -68,8 +74,8 @@ function update_gs {
|
|||||||
function pull_gs {
|
function pull_gs {
|
||||||
TASKTYPE='PULL'
|
TASKTYPE='PULL'
|
||||||
|
|
||||||
MESSAGE="[${CYAN}STAT${NC}] Pulling ${GRAVITY_FI} from ${REMOTE_HOST}"
|
MESSAGE="Pulling ${GRAVITY_FI} from ${REMOTE_HOST}"
|
||||||
echo -e "${MESSAGE}"
|
echo -e "${STAT} ${MESSAGE}"
|
||||||
rsync -v -e 'ssh -p 22' ${REMOTE_USER}@${REMOTE_HOST}:${PIHOLE_DIR}/${GRAVITY_FI} $HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/${GRAVITY_FI}.pull
|
rsync -v -e 'ssh -p 22' ${REMOTE_USER}@${REMOTE_HOST}:${PIHOLE_DIR}/${GRAVITY_FI} $HOME/${LOCAL_FOLDR}/${BACKUP_FOLD}/${GRAVITY_FI}.pull
|
||||||
if_validate
|
if_validate
|
||||||
echo -e "[${CYAN}STAT${NC}] Backing Up Current ${GRAVITY_FI} on $HOSTNAME"
|
echo -e "[${CYAN}STAT${NC}] Backing Up Current ${GRAVITY_FI} on $HOSTNAME"
|
||||||
@ -206,7 +212,7 @@ function exit_withchange {
|
|||||||
|
|
||||||
function if_validate {
|
function if_validate {
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
echo -e "[${RED}FAIL${NC}] Previous Command Failed"
|
echo -e "${FAIL} ${MESSAGE}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user