Grab local FTL hash correctly from FTL's own version output, and grab one digit less for remote hashes (also in debug log)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
pull/5016/head
Adam Warner 2 years ago
parent cdbe4c9b86
commit ba74051502
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173

@ -314,9 +314,9 @@ check_ftl_version() {
local FTL_VERSION FTL_COMMIT FTL_BRANCH
echo_current_diagnostic "FTL version"
# Use the built in command to check FTL's 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}')
FTL_VERSION=$(pihole-FTL version)
FTL_BRANCH=$(pihole-FTL branch)
FTL_COMMIT=$(pihole-FTL --hash)
log_write "${TICK} Version: ${FTL_VERSION}"

@ -31,7 +31,7 @@ function get_remote_version() {
function get_remote_hash(){
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,9);}' || return 1
git ls-remote "https://github.com/pi-hole/${1}" --tags "${2}" | awk '{print substr($0, 0,8);}' || return 1
}
# Source the setupvars config file
@ -113,7 +113,7 @@ addOrEditKeyValPair "${VERSION_FILE}" "FTL_VERSION" "${FTL_VERSION}"
FTL_BRANCH="$(pihole-FTL branch)"
addOrEditKeyValPair "${VERSION_FILE}" "FTL_BRANCH" "${FTL_BRANCH}"
FTL_HASH="$(pihole-FTL -v | cut -d "-" -f2)"
FTL_HASH="$(pihole-FTL --hash)"
addOrEditKeyValPair "${VERSION_FILE}" "FTL_HASH" "${FTL_HASH}"
GITHUB_FTL_VERSION="$(get_remote_version FTL)"

Loading…
Cancel
Save