* remove full dns restart

* change conditions for ftl restart

* run reload for non-smart tasks

* 3.6.3

* add user path to crontab

* ""

* include path

* $

* PATH=$PATH

* add Path_Fix
This commit is contained in:
Michael Stanclift 2022-03-28 14:18:16 -05:00 committed by GitHub
parent ac62915b5b
commit 087550742a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 19 deletions

View File

@ -1 +1 @@
3.6.2
3.6.3

View File

@ -3,7 +3,7 @@ SCRIPT_START=$SECONDS
# GRAVITY SYNC BY VMSTAN #####################
PROGRAM='Gravity Sync'
VERSION='3.6.2'
VERSION='3.6.3'
# For documentation or downloading updates visit https://github.com/vmstan/gravity-sync
# Requires Pi-Hole 5.x or higher already be installed, for help visit https://pi-hole.net

View File

@ -39,16 +39,11 @@ function task_automate {
clear_cron
fi
if [[ ${PATH} != *"/usr/sbin"* ]]
then
CRON_ENV_PATH=$'PATH=/bin:/usr/bin:/usr/sbin\n'
else
CRON_ENV_PATH=""
fi
path_fix
MESSAGE="${UI_AUTO_CRON_SAVING}"
echo_stat
(crontab -l 2>/dev/null; echo "${CRON_ENV_PATH}*/${INPUT_AUTO_FREQ} * * * * ${BASH_PATH} ${LOCAL_FOLDR}/${GS_FILENAME} smart > ${LOG_PATH}/${CRONJOB_LOG}") | crontab -
(crontab -l 2>/dev/null; echo "*/${INPUT_AUTO_FREQ} * * * * ${BASH_PATH} ${LOCAL_FOLDR}/${GS_FILENAME} smart > ${LOG_PATH}/${CRONJOB_LOG}") | crontab -
error_validate
elif [ $INPUT_AUTO_FREQ == 0 ]
then
@ -89,3 +84,10 @@ function task_cron {
show_crontab
}
function path_fix {
MESSAGE="Adding user path to Crontab"
echo_stat
(crontab -l 2>/dev/null; echo "PATH=$PATH") | crontab -
error_validate
}

View File

@ -111,10 +111,21 @@ function pull_gs_reload {
${PH_EXEC} restartdns reload-lists >/dev/null 2>&1
error_validate
MESSAGE="${UI_FTLDNS_CONFIG_RELOAD}"
echo_stat
${PH_EXEC} restartdns >/dev/null 2>&1
error_validate
if [ "${TASKTYPE}" == SMART ]
then
if [ "${PRICLCHANGE}" == "1" ] || [ "${SECCLCHANGE}" == "1" ] || [ "${PRICNCHANGE}" == "1" ] || [ "${SECCNCHANGE}" == "1" ]
then
MESSAGE="${UI_FTLDNS_CONFIG_RELOAD}"
echo_stat
${PH_EXEC} restartdns >/dev/null 2>&1
error_validate
fi
else
MESSAGE="${UI_FTLDNS_CONFIG_RELOAD}"
echo_stat
${PH_EXEC} restartdns >/dev/null 2>&1
error_validate
fi
}
## Pull Function

View File

@ -148,11 +148,23 @@ function push_gs_reload {
CMD_REQUESTED="${RH_EXEC} restartdns reload-lists"
create_sshcmd
MESSAGE="${UI_FTLDNS_CONFIG_PUSH_RELOAD}"
echo_stat
CMD_TIMEOUT=$BACKUP_TIMEOUT
CMD_REQUESTED="${RH_EXEC} restartdns"
create_sshcmd
if [ "${TASKTYPE}" == SMART ]
then
if [ "${PRICLCHANGE}" == "1" ] || [ "${SECCLCHANGE}" == "1" ] || [ "${PRICNCHANGE}" == "1" ] || [ "${SECCNCHANGE}" == "1" ]
then
MESSAGE="${UI_FTLDNS_CONFIG_PUSH_RELOAD}"
echo_stat
CMD_TIMEOUT=$BACKUP_TIMEOUT
CMD_REQUESTED="${RH_EXEC} restartdns"
create_sshcmd
fi
else
MESSAGE="${UI_FTLDNS_CONFIG_PUSH_RELOAD}"
echo_stat
CMD_TIMEOUT=$BACKUP_TIMEOUT
CMD_REQUESTED="${RH_EXEC} restartdns"
create_sshcmd
fi
}
## Push Function