Print version of server software.
This commit is contained in:
parent
778c86d52c
commit
9fd1bb773e
|
@ -31,6 +31,10 @@ function main()
|
||||||
echo "Misskey API found."
|
echo "Misskey API found."
|
||||||
json=$(curl -s -X POST "${misskeyinfo}")
|
json=$(curl -s -X POST "${misskeyinfo}")
|
||||||
|
|
||||||
|
# shellcheck disable=SC2155
|
||||||
|
local version=$(jq -r ".version" <<<"${json}")
|
||||||
|
echo "Misskey ${version} detected."
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
local email=$(jq -r ".maintainerEmail" <<<"${json}")
|
local email=$(jq -r ".maintainerEmail" <<<"${json}")
|
||||||
[[ -n "${email}" ]] && echo "E-Mail: ${email}"
|
[[ -n "${email}" ]] && echo "E-Mail: ${email}"
|
||||||
|
@ -51,10 +55,12 @@ function main()
|
||||||
elif curl -sIf "${nodeinfo}" | grep -iq 'Content-Type: application/json'; then
|
elif curl -sIf "${nodeinfo}" | grep -iq 'Content-Type: application/json'; then
|
||||||
echo "Nodeinfo found."
|
echo "Nodeinfo found."
|
||||||
json=$(curl -s "${nodeinfo}")
|
json=$(curl -s "${nodeinfo}")
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
local implementation=$(jq -r ".software.name" <<<"${json}")
|
local implementation=$(jq -r ".software.name" <<<"${json}")
|
||||||
|
# shellcheck disable=SC2155
|
||||||
[[ -n "${implementation}" ]] && echo "${implementation} detected."
|
local version=$(jq -r ".software.version" <<<"${json}")
|
||||||
|
echo "${implementation} ${version} detected."
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
local description=$(jq -r ".metadata.nodeDescription" <<<"${json}")
|
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
|
elif grep -Eq '"version":"[0-9]+\.[0-9]+\.[0-9]+"' <<<"${json}"; then
|
||||||
implementation="Mastodon"
|
implementation="Mastodon"
|
||||||
fi
|
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: "
|
echo -n "Description: "
|
||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
|
|
Loading…
Reference in New Issue