mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
3.6.3 (#313)
* 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:
parent
ac62915b5b
commit
087550742a
@ -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
|
||||
|
@ -38,17 +38,12 @@ function task_automate {
|
||||
then
|
||||
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
|
||||
}
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user