2022-10-06 21:50:07 +02:00
|
|
|
#!/usr/bin/env sh
|
2016-08-02 20:07:09 +01:00
|
|
|
# Pi-hole: A black hole for Internet advertisements
|
2017-02-22 11:55:20 -06:00
|
|
|
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
|
|
|
|
# Network-wide ad blocking via your own hardware.
|
|
|
|
#
|
2017-05-14 11:11:44 +10:00
|
|
|
# Show version numbers
|
2016-08-02 20:07:09 +01:00
|
|
|
#
|
2017-02-22 11:55:20 -06:00
|
|
|
# This file is copyright under the latest version of the EUPL.
|
|
|
|
# Please see LICENSE file for your rights under this license.
|
|
|
|
|
2023-12-09 22:31:36 +01:00
|
|
|
# Ignore warning about `local` being undefinded in POSIX
|
|
|
|
# shellcheck disable=SC3043
|
|
|
|
# https://github.com/koalaman/shellcheck/wiki/SC3043#exceptions
|
|
|
|
|
2022-10-06 22:08:57 +02:00
|
|
|
# Source the versions file poupulated by updatechecker.sh
|
2022-10-06 17:58:58 +02:00
|
|
|
cachedVersions="/etc/pihole/versions"
|
2018-07-20 13:27:30 -07:00
|
|
|
|
2022-10-06 17:58:58 +02:00
|
|
|
if [ -f ${cachedVersions} ]; then
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
. "$cachedVersions"
|
|
|
|
else
|
2022-10-14 13:21:31 +02:00
|
|
|
echo "Could not find /etc/pihole/versions. Running update now."
|
|
|
|
pihole updatechecker
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
. "$cachedVersions"
|
2022-10-06 17:58:58 +02:00
|
|
|
fi
|
2018-07-20 13:27:30 -07:00
|
|
|
|
2023-12-09 22:31:36 +01:00
|
|
|
main() {
|
|
|
|
local details
|
2023-12-09 23:09:58 +01:00
|
|
|
details=false
|
|
|
|
|
|
|
|
# Automatically show detailed information if
|
|
|
|
# at least one of the components is not on master branch
|
2024-02-09 19:22:53 +00:00
|
|
|
if [ ! "${CORE_BRANCH}" = "master" ] || [ ! "${WEB_BRANCH}" = "master" ] || [ ! "${FTL_BRANCH}" = "master" ]; then
|
2023-12-09 23:09:58 +01:00
|
|
|
details=true
|
|
|
|
fi
|
2023-12-09 22:31:36 +01:00
|
|
|
|
|
|
|
if [ "${details}" = true ]; then
|
|
|
|
echo "Core"
|
|
|
|
echo " Version is ${CORE_VERSION:=N/A} (Latest: ${GITHUB_CORE_VERSION:=N/A})"
|
|
|
|
echo " Branch is ${CORE_BRANCH:=N/A}"
|
|
|
|
echo " Hash is ${CORE_HASH:=N/A} (Latest: ${GITHUB_CORE_HASH:=N/A})"
|
|
|
|
echo "Web"
|
|
|
|
echo " Version is ${WEB_VERSION:=N/A} (Latest: ${GITHUB_WEB_VERSION:=N/A})"
|
|
|
|
echo " Branch is ${WEB_BRANCH:=N/A}"
|
|
|
|
echo " Hash is ${WEB_HASH:=N/A} (Latest: ${GITHUB_WEB_HASH:=N/A})"
|
|
|
|
echo "FTL"
|
|
|
|
echo " Version is ${FTL_VERSION:=N/A} (Latest: ${GITHUB_FTL_VERSION:=N/A})"
|
|
|
|
echo " Branch is ${FTL_BRANCH:=N/A}"
|
|
|
|
echo " Hash is ${FTL_HASH:=N/A} (Latest: ${GITHUB_FTL_HASH:=N/A})"
|
2022-11-14 20:39:34 +00:00
|
|
|
else
|
2023-12-09 22:31:36 +01:00
|
|
|
echo "Core version is ${CORE_VERSION:=N/A} (Latest: ${GITHUB_CORE_VERSION:=N/A})"
|
|
|
|
echo "Web version is ${WEB_VERSION:=N/A} (Latest: ${GITHUB_WEB_VERSION:=N/A})"
|
|
|
|
echo "FTL version is ${FTL_VERSION:=N/A} (Latest: ${GITHUB_FTL_VERSION:=N/A})"
|
2022-11-14 20:39:34 +00:00
|
|
|
fi
|
2016-10-18 12:07:11 +01:00
|
|
|
}
|
|
|
|
|
2023-12-09 23:09:58 +01:00
|
|
|
main
|