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:
authoryubiuser <ckoenig@posteo.de>2022-08-08 22:25:56 +0300
committerGitHub <noreply@github.com>2022-08-08 22:25:56 +0300
commita0419bc1f08b5b4a30a5ae5745b625c2ca556e8a (patch)
tree42d0ebecbdf982245dcdca430dbabd7618acb9f8
parentd38fcb05496e41fde9ca03c83f1a0221485b5e5e (diff)
parentd77677312cb5f1a1db48f1aeba898362e70383f6 (diff)
Merge pull request #4864 from pi-hole/debug_FTL_branch
Extend FTL information in debug log
-rwxr-xr-xadvanced/Scripts/piholeDebug.sh21
1 files changed, 19 insertions, 2 deletions
diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh
index 1707b872..e7f3cd48 100755
--- a/advanced/Scripts/piholeDebug.sh
+++ b/advanced/Scripts/piholeDebug.sh
@@ -332,17 +332,34 @@ compare_local_version_to_git_version() {
check_ftl_version() {
local ftl_name="FTL"
+ local FTL_VERSION FTL_COMMIT FTL_BRANCH
echo_current_diagnostic "${ftl_name} version"
# Use the built in command to check FTL's version
- FTL_VERSION=$(pihole-FTL version)
+ FTL_VERSION=$(pihole-FTL -vv | grep -m 1 Version | awk '{printf $2}')
+ FTL_BRANCH=$(pihole-FTL -vv | grep -m 1 Branch | awk '{printf $2}')
+ FTL_COMMIT=$(pihole-FTL -vv | grep -m 1 Commit | awk '{printf $2}')
+
# Compare the current FTL version to the remote version
if [[ "${FTL_VERSION}" == "$(pihole -v | awk '/FTL/ {print $6}' | cut -d ')' -f1)" ]]; then
# If they are the same, FTL is up-to-date
log_write "${TICK} ${ftl_name}: ${COL_GREEN}${FTL_VERSION}${COL_NC}"
else
# If not, show it in yellow, signifying there is an update
- log_write "${TICK} ${ftl_name}: ${COL_YELLOW}${FTL_VERSION}${COL_NC} (${FAQ_UPDATE_PI_HOLE})"
+ log_write "${INFO} ${ftl_name}: ${COL_YELLOW}${FTL_VERSION}${COL_NC} (${FAQ_UPDATE_PI_HOLE})"
fi
+
+ # If they use the master branch, they are on the stable codebase
+ if [[ "${FTL_BRANCH}" == "master" ]]; then
+ # so the color of the text is green
+ log_write "${INFO} Branch: ${COL_GREEN}${FTL_BRANCH}${COL_NC}"
+ # If it is any other branch, they are in a development branch
+ else
+ # So show that in yellow, signifying it's something to take a look at, but not a critical error
+ log_write "${INFO} Branch: ${COL_YELLOW}${FTL_BRANCH}${COL_NC} (${FAQ_CHECKOUT_COMMAND})"
+ fi
+
+ # echo the current commit
+ log_write "${INFO} Commit: ${FTL_COMMIT}"
}
# Checks the core version of the Pi-hole codebase