1
0
Fork 0

check_gitea: small enhancement

We really should use a HTML parser but I like the monitoring probes
to be as light on dependencies as possible.
This commit is contained in:
Chl 2020-01-09 22:03:33 +01:00
parent 67044d45c8
commit 9da2d8701e

View file

@ -8,7 +8,7 @@ set -e
# note: some local problems with IPv4, the quickest way was to force IPv6.
LOCAL_VERSION="$( wget -6 -O - -q "https://$( hostname -f )/api/v1/version" | sed -n 's/{"version":"\([^"]\+\)"}/\1/p' )"
UPSTREAM_VERSION="$( wget -q -O - "https://dl.gitea.io/gitea/" | egrep -- '<a href="/gitea/[0-9]+\.[0-9]+\.[0-9]+/"' | egrep -o "[0-9]+\.[0-9]+\.[0-9]+" | sort --version-sort | tail -n 1 )"
UPSTREAM_VERSION="$( wget -q -O - "https://dl.gitea.io/gitea/" | egrep -o -- '<a href="/gitea/[0-9]+\.[0-9]+\.[0-9]+/"' | egrep -o "[0-9]+\.[0-9]+\.[0-9]+" | sort --version-sort | tail -n 1 )"
if [ "$UPSTREAM_VERSION" = "$LOCAL_VERSION" ]; then
echo "OK ($LOCAL_VERSION / $UPSTREAM_VERSION)"