mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Check existance of remote custom.list
This commit is contained in:
parent
3e0d06617e
commit
ca4e99cb1e
@ -485,25 +485,32 @@ function md5_compare {
|
|||||||
MESSAGE="Comparing ${CUSTOM_DNS} Changes"
|
MESSAGE="Comparing ${CUSTOM_DNS} Changes"
|
||||||
echo_info
|
echo_info
|
||||||
|
|
||||||
MESSAGE="Analyzing Remote ${CUSTOM_DNS}"
|
if ${SSHPASSWORD} ssh -p ${SSH_PORT} -i "$HOME/${SSH_PKIF}" ${REMOTE_USER}@${REMOTE_HOST} test -e ${PIHOLE_DIR}/${CUSTOM_DNS}
|
||||||
echo_stat
|
|
||||||
primaryCLMD5=$(${SSHPASSWORD} ssh -p ${SSH_PORT} -i "$HOME/${SSH_PKIF}" ${REMOTE_USER}@${REMOTE_HOST} "md5sum ${PIHOLE_DIR}/${CUSTOM_DNS}")
|
|
||||||
error_validate
|
|
||||||
|
|
||||||
MESSAGE="Analyzing Local ${CUSTOM_DNS}"
|
|
||||||
echo_stat
|
|
||||||
secondCLMD5=$(md5sum ${PIHOLE_DIR}/${CUSTOM_DNS})
|
|
||||||
error_validate
|
|
||||||
|
|
||||||
if [ "$primaryCLMD5" == "$secondCLMD5" ]
|
|
||||||
then
|
then
|
||||||
MESSAGE="No Differences in ${CUSTOM_DNS}"
|
MESSAGE="Analyzing Remote ${CUSTOM_DNS}"
|
||||||
echo_info
|
echo_stat
|
||||||
HASHMARK=$((HASHMARK+0))
|
|
||||||
|
primaryCLMD5=$(${SSHPASSWORD} ssh -p ${SSH_PORT} -i "$HOME/${SSH_PKIF}" ${REMOTE_USER}@${REMOTE_HOST} "md5sum ${PIHOLE_DIR}/${CUSTOM_DNS}")
|
||||||
|
error_validate
|
||||||
|
|
||||||
|
MESSAGE="Analyzing Local ${CUSTOM_DNS}"
|
||||||
|
echo_stat
|
||||||
|
secondCLMD5=$(md5sum ${PIHOLE_DIR}/${CUSTOM_DNS})
|
||||||
|
error_validate
|
||||||
|
|
||||||
|
if [ "$primaryCLMD5" == "$secondCLMD5" ]
|
||||||
|
then
|
||||||
|
MESSAGE="No Differences in ${CUSTOM_DNS}"
|
||||||
|
echo_info
|
||||||
|
HASHMARK=$((HASHMARK+0))
|
||||||
|
else
|
||||||
|
MESSAGE="Changes Detected in ${CUSTOM_DNS}"
|
||||||
|
echo_info
|
||||||
|
HASHMARK=$((HASHMARK+1))
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
MESSAGE="Changes Detected in ${CUSTOM_DNS}"
|
MESSAGE="No Remote ${CUSTOM_DNS} Detected"
|
||||||
echo_info
|
echo_info
|
||||||
HASHMARK=$((HASHMARK+1))
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
MESSAGE="No Local ${CUSTOM_DNS} Detected"
|
MESSAGE="No Local ${CUSTOM_DNS} Detected"
|
||||||
@ -512,7 +519,7 @@ function md5_compare {
|
|||||||
|
|
||||||
if [ "$HASHMARK" != "0" ]
|
if [ "$HASHMARK" != "0" ]
|
||||||
then
|
then
|
||||||
MESSAGE="Replication Required"
|
MESSAGE="Replication Suggested"
|
||||||
echo_info
|
echo_info
|
||||||
HASHMARK=$((HASHMARK+0))
|
HASHMARK=$((HASHMARK+0))
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user