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:
authorChristian König <ckoenig@posteo.de>2022-10-14 11:29:14 +0300
committerChristian König <ckoenig@posteo.de>2022-10-14 11:29:14 +0300
commitd85982dc515282da985f87f60ca0dd36ae51e3c5 (patch)
tree2ecde7021635e7e7979895466a81129117a5ca42
parent5c61f6cb65e32c2d96d10bdf31efe5440b1e01cf (diff)
Use versions file instead of github api to get latest version
Signed-off-by: Christian König <ckoenig@posteo.de>
-rwxr-xr-xadvanced/Scripts/piholeDebug.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh
index 3799448b..59b2af8b 100755
--- a/advanced/Scripts/piholeDebug.sh
+++ b/advanced/Scripts/piholeDebug.sh
@@ -238,14 +238,19 @@ compare_local_version_to_git_version() {
local git_dir="${1}"
# The named component of the project (Core or Web)
local pihole_component="${2}"
+
# If we are checking the Core versions,
if [[ "${pihole_component}" == "Core" ]]; then
- # set the github repo name
- local repo_name="pi-hole"
+ local remote_version
+ # remote version is taken from /etc/pihole/versions (sourced above)
+ remote_version="${GITHUB_CORE_VERSION}"
elif [[ "${pihole_component}" == "Web" ]]; then
- # set the github repo name
- #shellcheck disable=2034
- local repo_name="adminlte"
+ local remote_version
+ # remote version is taken from /etc/pihole/versions (sourced above)
+ remote_version="${GITHUB_WEB_VERSION}"
+ fi
+ if [ -z "${remote_version}" ]; then
+ remote_version="N/A"
fi
# Display what we are checking
echo_current_diagnostic "${pihole_component} version"
@@ -270,8 +275,6 @@ compare_local_version_to_git_version() {
# Status of the repo
local local_status
local_status=$(git status -s)
- local remote_version
- remote_version=$(curl -s "https://api.github.com/repos/pi-hole/${repo_name}/releases/latest" 2> /dev/null | jq --raw-output .tag_name)
# echo this information out to the user in a nice format
# If the current version matches the latest tag, the user is up-to-date
if [[ "${local_version}" == "${remote_version}" ]]; then
@@ -338,7 +341,11 @@ check_ftl_version() {
FTL_BRANCH=$(pihole-FTL -vv | grep -m 1 Branch | awk '{printf $2}')
FTL_COMMIT=$(pihole-FTL -vv | grep -m 1 Commit | awk '{printf $2}')
- remote_version=$(curl -s 'https://api.github.com/repos/pi-hole/ftl/releases/latest' 2> /dev/null | jq --raw-output .tag_name)
+ # remote version is taken from /etc/pihole/versions (sourced above)
+ remote_version="${GITHUB_FTL_VERSION}"
+ if [ -z "${remote_version}" ]; then
+ remote_version="N/A"
+ fi
# Compare the current FTL version to the remote version
if [[ "${FTL_VERSION}" == "${remote_version}" ]]; then