Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Russell <jpgpi250@gmail.com>2022-09-24 18:14:44 +0300
committerGitHub <noreply@github.com>2022-09-24 18:14:44 +0300
commit951b4ed0029f8001f1ee0d4969f99b9f5b7f4b10 (patch)
treee20408bdd0fe963f3085c728980f590987ae1f55
parent1c1407e08391dbc834aec161332f09d5af75d561 (diff)
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>
-rwxr-xr-xadvanced/Scripts/piholeCheckout.sh9
-rw-r--r--advanced/Templates/pihole.cron3
2 files changed, 9 insertions, 3 deletions
diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh
index 7c4a1f77..8c4c6db3 100755
--- a/advanced/Scripts/piholeCheckout.sh
+++ b/advanced/Scripts/piholeCheckout.sh
@@ -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}') )
diff --git a/advanced/Templates/pihole.cron b/advanced/Templates/pihole.cron
index 46640fbb..336a66fe 100644
--- a/advanced/Templates/pihole.cron
+++ b/advanced/Templates/pihole.cron
@@ -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