From 8cba1092bff1a48f9864f70e939b2036ceb44b99 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 25 May 2022 20:32:55 +0200 Subject: [PATCH] instanceinfo: Fix soapbox detection Soapbox answers with a JSON error message. --- instanceinfo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instanceinfo.sh b/instanceinfo.sh index 290034a..cb399fd 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Print some basic info about fediverse instances. -# Version: 2021-02-22_1 +# Version: 2022-05-25_1 if [[ -z "${1}" ]]; then echo "usage: ${0} DOMAIN" >&2 @@ -186,7 +186,7 @@ function main() local mastoinfo="https://${instance}/api/v1/instance" local misskeyinfo="https://${instance}/api/meta" - if ${mycurl} -ILf -X POST "${misskeyinfo}" | grep -iq 'Content-Type: application/json'; then + if ${mycurl} -ILf -X POST "${misskeyinfo}" | grep -iq 'HTTP.*200'; then echo "Misskey API found." parse_misskey "${instance}" "${misskeyinfo}" elif ${mycurl} -ILf "${nodeinfo}" | grep -iq 'Content-Type: application/json' \