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

* eliminate updatechecker local from pihole cron job

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>

* resolving stickler-ci items

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>

* undo changes to updatecheck.sh (request from PromoFaux)

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>

* applied recommendation from PromoFaux

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>

* Indent the code inside the function

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>

* removed unnecessary updatecheck for core

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>

* eliminate updatechecker local from pihole cron job

Co-authored-by: jpgpi250 <jpgpi250@gmail.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>

Signed-off-by: jpgpi250 <jpgpi250@gmail.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Peter Russell 2022-09-24 17:14:44 +02:00 committed by GitHub
parent 1c1407e083
commit 951b4ed002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -42,6 +42,11 @@ warning1() {
esac
}
updateCheckFunc() {
/opt/pihole/updatecheck.sh
/opt/pihole/updatecheck.sh x remote
}
checkout() {
local corebranches
local webbranches
@ -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
@ -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}') )

View file

@ -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