From 65dd7a42c251a29526cbecc99d039558674af1f1 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Mon, 25 May 2020 23:58:26 -0500 Subject: [PATCH] fix cron service restart --- gravity-sync.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gravity-sync.sh b/gravity-sync.sh index dded614..88d7c51 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -2,7 +2,7 @@ # GRAVITY SYNC BY VMSTAN ##################### PROGRAM='Gravity Sync' -VERSION='1.3.1' +VERSION='1.3.3' # Must execute from a location in the home folder of the user who own's it (ex: /home/pi/gravity-sync) # Configure certificate based SSH authentication between the Pi-hole HA nodes - it does not use passwords @@ -130,16 +130,18 @@ function pull_gs { sudo chown pihole:pihole ${PIHOLE_DIR}/${GRAVITY_FI} >/dev/null 2>&1 error_validate - sleep 3 + MESSAGE="Pausing One Second" + echo -e "${INFO} ${MESSAGE}" + sleep 1 MESSAGE="Updating FTLDNS Configuration" echo -en "${STAT} ${MESSAGE}" - pihole restartdns reloadlists >/dev/null 2>&1 + /usr/local/bin/pihole restartdns reloadlists >/dev/null 2>&1 error_validate MESSAGE="Reloading FTLDNS Services" echo -en "${STAT} ${MESSAGE}" - pihole restartdns >/dev/null 2>&1 + /usr/local/bin/pihole restartdns >/dev/null 2>&1 error_validate logs_export @@ -178,7 +180,9 @@ function push_gs { ${SSHPASSWORD} ssh ${REMOTE_USER}@${REMOTE_HOST} "sudo chown pihole:pihole ${PIHOLE_DIR}/${GRAVITY_FI}" >/dev/null 2>&1 error_validate - sleep 3 + MESSAGE="Pausing One Second" + echo -e "${INFO} ${MESSAGE}" + sleep 1 MESSAGE="Updating FTLDNS Configuration" echo -en "${STAT} ${MESSAGE}" @@ -220,22 +224,22 @@ function show_crontab { CRONPATH="$HOME/${LOCAL_FOLDR}/${CRONJOB_LOG}" MESSAGE="Replaying Last Cronjob" - echo -e "${STAT} ${MESSAGE}" + echo -en "${STAT} ${MESSAGE}" if [ -f ${CRONPATH} ] then if [ -s ${CRONPATH} ] - echo -e "${GOOD} ${MESSAGE}" + echo -e "\r${GOOD} ${MESSAGE}" logs_crontab exit_nochange then - echo -e "${FAIL} ${MESSAGE}" + echo -e "\r${FAIL} ${MESSAGE}" echo -e "${INFO} ${CRONPATH} appears empty" exit_nochange fi else - echo -e "${FAIL} ${MESSAGE}" - echo -e "${YELLOW}${CRONPATH}${NC} cannot be located" + echo -e "\r${FAIL} ${MESSAGE}" + echo -e "${INFO} ${CRONPATH} cannot be located" exit_nochange fi }