Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cronjob that checks local versions every 10 minutes - only check when required #4939

Merged
merged 10 commits into from Sep 24, 2022
9 changes: 9 additions & 0 deletions advanced/Scripts/piholeCheckout.sh
Expand Up @@ -42,6 +42,11 @@ warning1() {
esac
}

updateCheckFunc() {
/opt/pihole/updatecheck.sh
/opt/pihole/updatecheck.sh x remote
}

checkout() {
local corebranches
local webbranches
Expand Down Expand Up @@ -164,6 +169,8 @@ checkout() {
exit 1
fi
checkout_pull_branch "${webInterfaceDir}" "${2}"
# Force an update of the updatechecker
updateCheckFunc
elif [[ "${1}" == "ftl" ]] ; then
local path
local oldbranch
Expand All @@ -178,6 +185,8 @@ checkout() {
FTLinstall "${binary}"
restart_service pihole-FTL
enable_service pihole-FTL
# Force an update of the updatechecker
updateCheckFunc
else
echo " ${CROSS} Requested branch \"${2}\" is not available"
ftlbranches=( $(git ls-remote https://github.com/pi-hole/ftl | grep 'heads' | sed 's/refs\/heads\///;s/ //g' | awk '{print $2}') )
Expand Down
3 changes: 0 additions & 3 deletions advanced/Templates/pihole.cron
Expand Up @@ -28,9 +28,6 @@

@reboot root /usr/sbin/logrotate --state /var/lib/logrotate/pihole /etc/pihole/logrotate

# Pi-hole: Grab local version and branch every 10 minutes
*/10 * * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local

# Pi-hole: Grab remote version every 24 hours
59 17 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote
@reboot root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote reboot