From f35f663be9cfdcc4fd5757e2ad61d13122ad5d10 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 7 Jun 2018 20:20:16 +0200 Subject: [PATCH] Add api.php?updatecheck endpoint Signed-off-by: DL6ER --- api.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api.php b/api.php index 16964a04..ade11750 100644 --- a/api.php +++ b/api.php @@ -73,6 +73,18 @@ elseif (isset($_GET['disable']) && $auth) } $data = array_merge($data, array("status" => "disabled")); } +elseif (isset($_GET['updatecheck'])) +{ + // Determine if updates are available for Pi-hole + // using the same script that we use for the footer + // on the dashboard (update notifications are + // suppressed if on development branches) + require "scripts/pi-hole/php/update_checker.php"; + $updates = array("core_update" => $core_update, + "web_update" => $web_update, + "FTL_update" => $FTL_update); + $data = array_merge($data, $updates); +} // Other API functions require("api_FTL.php");