instanceinfo.sh: Improved Misskey parsing.
This commit is contained in:
parent
e34a41f912
commit
42c9f843ec
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
# Print some basic info about fediverse instances.
|
||||
|
||||
# Version: 2019-07-26_2
|
||||
# Version: 2019-07-27_3
|
||||
|
||||
if [[ -z "${1}" ]]; then
|
||||
echo "usage: ${0} DOMAIN" >&2
|
||||
|
@ -151,22 +151,22 @@ function parse_misskey()
|
|||
|
||||
# shellcheck disable=SC2155
|
||||
local version=$(jq -r ".version" <<<"${json}")
|
||||
echo "Misskey ${version} detected."
|
||||
[[ "${version}" != "null" ]] && echo "Misskey ${version} detected."
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
local email=$(jq -r ".maintainerEmail" <<<"${json}")
|
||||
[[ -n "${email}" ]] && echo "E-Mail: ${email}"
|
||||
[[ "${email}" != "null" ]] && echo "E-Mail: ${email}"
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
local users=$(${mycurl} -X POST "https://${instance}/api/stats" | jq -r ".usersCount")
|
||||
[[ -n ${users} ]] && echo "Number of users: ${users}"
|
||||
[[ ${users} != "null" ]] && echo "Number of users: ${users}"
|
||||
|
||||
echo -n "Open registrations: "
|
||||
jq -r ".features.registration" <<<"${json}"
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
local tos=$(jq -r ".ToSUrl" <<<"${json}")
|
||||
[[ -n "${tos}" ]] && echo "ToS: ${tos}"
|
||||
[[ "${tos}" != "null" ]] && echo "ToS: ${tos}"
|
||||
}
|
||||
|
||||
function main()
|
||||
|
|
Loading…
Reference in New Issue