From 42c9f843ec7b7f317a848f5978caba090f79bc24 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 27 Jul 2019 00:39:46 +0200 Subject: [PATCH] instanceinfo.sh: Improved Misskey parsing. --- instanceinfo.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/instanceinfo.sh b/instanceinfo.sh index 89e16d8..3d2fb4f 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -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()