From 6ce754164b27735f676ec2baaa2e3bcd44e691f2 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 24 Jun 2019 17:28:24 +0200 Subject: [PATCH] instanceinfo.sh: Removed unused function pretty(). --- instanceinfo.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/instanceinfo.sh b/instanceinfo.sh index 34156c5..c74b505 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Print some basic info about fediverse instances. -# Version: 2019-06-24_5 +# Version: 2019-06-24_6 if [[ -z "${1}" ]]; then echo "usage: ${0} DOMAIN" >&2 @@ -13,16 +13,6 @@ if ! command -v jq > /dev/null; then exit 2 fi -function pretty() -{ - local extract="${*}" - if command -v json_pp > /dev/null; then - echo "{${extract}}" | json_pp - else - echo "${extract}" - fi -} - function striphtml() { local extract="${*}" @@ -51,9 +41,9 @@ function main() # NOTE: I'm not sure what the returned data means exactly and I couldn't find the API-documentation. So I commented it out for now. # # shellcheck disable=SC2155 - # local federation=$(curl -s -X POST "https://${instance}/api/federation/instances" | grep -Eo '"host":"[^"]+",' | sed 's/"host"://g') + # local federation=$(curl -s -X POST "https://${instance}/api/federation/instances" | jq ".[].host") # # shellcheck disable=SC2046 - # [[ -n ${federation} ]] && echo -n "Federates with: " && pretty '"":['"${federation}"'""]' + # [[ -n ${federation} ]] && echo -n "Federates with: " && echo "${federation}" # shellcheck disable=SC2155 local tos=$(jq -r ".ToSUrl" <<<"${json}")