mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Flesh out compare
This commit is contained in:
parent
20a2cb88fe
commit
68aa883c5f
@ -312,17 +312,26 @@ function show_version {
|
|||||||
|
|
||||||
# Look for Changes
|
# Look for Changes
|
||||||
function md5_compare {
|
function md5_compare {
|
||||||
|
echo -e "${INFO} Looking for Changes"
|
||||||
|
|
||||||
|
MESSAGE="Analyzing Remote ${GRAVITY_FI}"
|
||||||
|
echo -e "${STAT} ${MESSAGE}"
|
||||||
primaryMD5=$(ssh ${REMOTE_USER}@${REMOTE_HOST} 'md5sum /etc/pihole/gravity.db')
|
primaryMD5=$(ssh ${REMOTE_USER}@${REMOTE_HOST} 'md5sum /etc/pihole/gravity.db')
|
||||||
|
error_validate
|
||||||
|
|
||||||
|
MESSAGE="Analyzing Local ${GRAVITY_FI}"
|
||||||
|
echo -e "${STAT} ${MESSAGE}"
|
||||||
secondMD5=$(md5sum ${PIHOLE_DIR}/${GRAVITY_FI})
|
secondMD5=$(md5sum ${PIHOLE_DIR}/${GRAVITY_FI})
|
||||||
|
error_validate
|
||||||
|
|
||||||
if [ "$primaryMD5" == "$secondMD5" ]
|
if [ "$primaryMD5" == "$secondMD5" ]
|
||||||
then
|
then
|
||||||
echo "MD5 Match"
|
echo -e "${INFO} No Changes in ${GRAVITY_FI}"
|
||||||
|
exit_nochange
|
||||||
else
|
else
|
||||||
echo "MD5 Changed"
|
echo -e "${INFO} Changes Detected in ${GRAVITY_FI}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit_nochange
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# SCRIPT EXECUTION ###########################
|
# SCRIPT EXECUTION ###########################
|
||||||
@ -376,14 +385,18 @@ case $# in
|
|||||||
|
|
||||||
update)
|
update)
|
||||||
# TASKTYPE='UPDATE'
|
# TASKTYPE='UPDATE'
|
||||||
echo -e "[${GREEN}GOOD${NC}] Update Requested"
|
echo -e "${GOOD} ${MESSAGE}"
|
||||||
|
|
||||||
|
echo -e "${INFO} Update Requested"
|
||||||
update_gs
|
update_gs
|
||||||
exit_nochange
|
exit_nochange
|
||||||
;;
|
;;
|
||||||
|
|
||||||
beta)
|
beta)
|
||||||
# TASKTYPE='BETA'
|
# TASKTYPE='BETA'
|
||||||
echo -e "[${GREEN}GOOD${NC}] Beta Update Requested"
|
echo -e "${GOOD} ${MESSAGE}"
|
||||||
|
|
||||||
|
echo -e "${INFO} Beta Update Requested"
|
||||||
beta_gs
|
beta_gs
|
||||||
exit_nochange
|
exit_nochange
|
||||||
;;
|
;;
|
||||||
@ -398,9 +411,8 @@ case $# in
|
|||||||
compare)
|
compare)
|
||||||
TASKTYPE='COMPARE'
|
TASKTYPE='COMPARE'
|
||||||
|
|
||||||
import_gs
|
|
||||||
|
|
||||||
echo -e "${GOOD} ${MESSAGE}"
|
echo -e "${GOOD} ${MESSAGE}"
|
||||||
|
import_gs
|
||||||
md5_compare
|
md5_compare
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user