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:
parent
67044d45c8
commit
9da2d8701e
1 changed files with 1 additions and 1 deletions
|
@ -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)"
|
||||
|
|
Loading…
Reference in a new issue