instanceinfo.sh: Removed unused function pretty().

This commit is contained in:
tastytea 2019-06-24 17:28:24 +02:00
parent 223ff3c448
commit 6ce754164b
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 3 additions and 13 deletions

View File

@ -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}")