Check for rsync on remote host

This commit is contained in:
Michael Stanclift 2020-07-08 20:48:53 -05:00
parent 393924a836
commit 4d824c54eb
2 changed files with 20 additions and 1 deletions

View File

@ -215,4 +215,4 @@ For those who really love Pi-hole and Gravity Sync. Combining the best of both w
2. The VIPs are managed by the keepalived service on each side and will determine which of two Pi-hole responds. You can make your configuration changes to the active VIP address on either side.
3. Client queries one of the two VIP servers, and the responding Pi-hole does it's thing.
Here we use `./gravity-sync pull` on the secondary Pi-hole at each side, and ofset the update intervals from the main sync.
Here we use `./gravity-sync pull` on the secondary Pi-hole at each side, and off-set the update intervals from the main sync.

View File

@ -1013,6 +1013,23 @@ function detect_ssh {
fi
}
function detect_remotersync {
MESSAGE="Validating RSYNC Installed on ${REMOTE_HOST}"
echo_stat
REMOTERSYNC=$(${SSHPASSWORD} ${SSH_CMD} -p ${SSH_PORT} -i "$HOME/${SSH_PKIF}" ${REMOTE_USER}@${REMOTE_HOST} "hash rsync")
if [ "${REMOTERSYNC}" == "-bash: hash: rsync: not found"
then
echo_fail
MESSAGE="Please install RSYNC on ${REMOTE_HOST}"
echo_info
exit_nochange
else
echo_good
fi
}
## Error Validation
function error_validate {
if [ "$?" != "0" ]
@ -1305,6 +1322,8 @@ function config_generate {
validate_os_sshpass
detect_remotersync
exit_withchange
}