Print version of server software.

This commit is contained in:
tastytea 2019-06-25 02:27:07 +02:00
parent 778c86d52c
commit 9fd1bb773e
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 13 additions and 3 deletions

View File

@ -31,6 +31,10 @@ function main()
echo "Misskey API found."
json=$(curl -s -X POST "${misskeyinfo}")
# shellcheck disable=SC2155
local version=$(jq -r ".version" <<<"${json}")
echo "Misskey ${version} detected."
# shellcheck disable=SC2155
local email=$(jq -r ".maintainerEmail" <<<"${json}")
[[ -n "${email}" ]] && echo "E-Mail: ${email}"
@ -51,10 +55,12 @@ function main()
elif curl -sIf "${nodeinfo}" | grep -iq 'Content-Type: application/json'; then
echo "Nodeinfo found."
json=$(curl -s "${nodeinfo}")
# shellcheck disable=SC2155
local implementation=$(jq -r ".software.name" <<<"${json}")
[[ -n "${implementation}" ]] && echo "${implementation} detected."
# shellcheck disable=SC2155
local version=$(jq -r ".software.version" <<<"${json}")
echo "${implementation} ${version} detected."
# shellcheck disable=SC2155
local description=$(jq -r ".metadata.nodeDescription" <<<"${json}")
@ -97,7 +103,11 @@ function main()
elif grep -Eq '"version":"[0-9]+\.[0-9]+\.[0-9]+"' <<<"${json}"; then
implementation="Mastodon"
fi
[[ -n "${implementation}" ]] && echo "${implementation} detected."
if [[ -n "${implementation}" ]]; then
# shellcheck disable=SC2155
local version=$(jq -r ".version" <<<"${json}")
echo "${implementation} ${version} detected."
fi
echo -n "Description: "
# shellcheck disable=SC2046