Add md5 comparison function

This commit is contained in:
Michael Stanclift 2020-05-24 20:19:40 -05:00
parent a64e31f0cb
commit 1b4d73ebb5

View File

@ -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}"