mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Add md5 comparison function
This commit is contained in:
parent
a64e31f0cb
commit
1b4d73ebb5
@ -296,6 +296,21 @@ function show_version {
|
||||
echo -e "${INFO} ${PROGRAM} ${VERSION}"
|
||||
}
|
||||
|
||||
# Look for Changes
|
||||
function md5_compare {
|
||||
primaryMD5=$(ssh ${REMOTE_USER}@${REMOTE_HOST} 'md5sum ${PIHOLE_DIR}/${GRAVITY_FI}')
|
||||
secondMD5=$(md5sum ${PIHOLE_DIR}/${GRAVITY_FI})
|
||||
|
||||
if [ "$primaryMD5" == "$secondMD5" ]
|
||||
then
|
||||
echo "MD5 Match"
|
||||
else
|
||||
echo "MD5 Changed"
|
||||
fi
|
||||
|
||||
exit_nochange
|
||||
}
|
||||
|
||||
# SCRIPT EXECUTION ###########################
|
||||
|
||||
show_version
|
||||
@ -359,6 +374,11 @@ case $# in
|
||||
logs_gs
|
||||
;;
|
||||
|
||||
compare)
|
||||
TASKTYPE='COMPARE'
|
||||
echo -e "${GOOD} ${MESSAGE}"
|
||||
md5_compare
|
||||
|
||||
cron)
|
||||
TASKTYPE='CRON'
|
||||
echo -e "${GOOD} ${MESSAGE}"
|
||||
|
Loading…
Reference in New Issue
Block a user