diff --git a/instanceinfo.sh b/instanceinfo.sh index f625b2c..ef3c2a6 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Print some basic info about fediverse instances. -# Version: 2019-07-23_1 +# Version: 2019-07-23_2 if [[ -z "${1}" ]]; then echo "usage: ${0} DOMAIN" >&2 @@ -65,8 +65,17 @@ function parse_nodeinfo() echo -n "Open registrations: " jq -r ".openRegistrations" <<<"${json}" + if [[ "${implementation}" == "activityrelay" ]]; then + # shellcheck disable=SC2155 + local peers=$(jq -r ".metadata.peers" <<<"${json}") + [[ "${peers}" != "null" ]] && echo "Peers: ${peers}" + fi + # shellcheck disable=SC2155 local restrictions=$(jq -r ".metadata.federation.mrf_simple" <<<"${json}") + if [[ "${restrictions}" == "null" ]]; then + restrictions=$(jq -r ".federation" <<<"${json}") + fi [[ "${restrictions}" != "null" ]] && echo "Federation restrictions: ${restrictions}" if [[ "${implementation}" == "pleroma" ]]; then