2022-10-06 19:50:07 +00:00
|
|
|
#!/usr/bin/env sh
|
2016-08-02 19:07:09 +00:00
|
|
|
# Pi-hole: A black hole for Internet advertisements
|
2017-02-22 17:55:20 +00:00
|
|
|
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
|
|
|
|
# Network-wide ad blocking via your own hardware.
|
|
|
|
#
|
2017-05-14 01:11:44 +00:00
|
|
|
# Show version numbers
|
2016-08-02 19:07:09 +00:00
|
|
|
#
|
2017-02-22 17:55:20 +00: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 21:31:36 +00:00
|
|
|
# Ignore warning about `local` being undefinded in POSIX
|
|
|
|
# shellcheck disable=SC3043
|
|
|
|
# https://github.com/koalaman/shellcheck/wiki/SC3043#exceptions
|
|
|
|
|
2022-10-06 20:08:57 +00:00
|
|
|
# Source the versions file poupulated by updatechecker.sh
|
2022-10-06 15:58:58 +00:00
|
|
|
cachedVersions="/etc/pihole/versions"
|
2018-07-20 20:27:30 +00:00
|
|
|
|
2022-10-06 15:58:58 +00:00
|
|
|
if [ -f ${cachedVersions} ]; then
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
. "$cachedVersions"
|
|
|
|
else
|
2022-10-14 11:21:31 +00:00
|
|
|
echo "Could not find /etc/pihole/versions. Running update now."
|
|
|
|
pihole updatechecker
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
. "$cachedVersions"
|
2022-10-06 15:58:58 +00:00
|
|
|
fi
|
2018-07-20 20:27:30 +00:00
|
|
|
|
2023-12-09 21:31:36 +00:00
|
|
|
main() {
|
|
|
|
local details
|
2023-12-09 22:09:58 +00: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 22:09:58 +00:00
|
|
|
details=true
|
|
|
|
fi
|
2023-12-09 21:31:36 +00: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 21:31:36 +00: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 11:07:11 +00:00
|
|
|
}
|
|
|
|
|
2023-12-09 22:09:58 +00:00
|
|
|
main
|