mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
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:
parent
1c1407e083
commit
951b4ed002
2 changed files with 9 additions and 3 deletions
|
@ -42,6 +42,11 @@ warning1() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateCheckFunc() {
|
||||||
|
/opt/pihole/updatecheck.sh
|
||||||
|
/opt/pihole/updatecheck.sh x remote
|
||||||
|
}
|
||||||
|
|
||||||
checkout() {
|
checkout() {
|
||||||
local corebranches
|
local corebranches
|
||||||
local webbranches
|
local webbranches
|
||||||
|
@ -164,6 +169,8 @@ checkout() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
checkout_pull_branch "${webInterfaceDir}" "${2}"
|
checkout_pull_branch "${webInterfaceDir}" "${2}"
|
||||||
|
# Force an update of the updatechecker
|
||||||
|
updateCheckFunc
|
||||||
elif [[ "${1}" == "ftl" ]] ; then
|
elif [[ "${1}" == "ftl" ]] ; then
|
||||||
local path
|
local path
|
||||||
local oldbranch
|
local oldbranch
|
||||||
|
@ -178,6 +185,8 @@ checkout() {
|
||||||
FTLinstall "${binary}"
|
FTLinstall "${binary}"
|
||||||
restart_service pihole-FTL
|
restart_service pihole-FTL
|
||||||
enable_service pihole-FTL
|
enable_service pihole-FTL
|
||||||
|
# Force an update of the updatechecker
|
||||||
|
updateCheckFunc
|
||||||
else
|
else
|
||||||
echo " ${CROSS} Requested branch \"${2}\" is not available"
|
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}') )
|
ftlbranches=( $(git ls-remote https://github.com/pi-hole/ftl | grep 'heads' | sed 's/refs\/heads\///;s/ //g' | awk '{print $2}') )
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
|
|
||||||
@reboot root /usr/sbin/logrotate --state /var/lib/logrotate/pihole /etc/pihole/logrotate
|
@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
|
# Pi-hole: Grab remote version every 24 hours
|
||||||
59 17 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote
|
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
|
@reboot root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote reboot
|
||||||
|
|
Loading…
Reference in a new issue