Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
3.6.3 (#313)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vmstan authored Mar 28, 2022
1 parent ac62915 commit 0875507
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 19 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.2
3.6.3
2 changes: 1 addition & 1 deletion gravity-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions includes/gs-automate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
19 changes: 15 additions & 4 deletions includes/gs-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 17 additions & 5 deletions includes/gs-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0875507

Please sign in to comment.