logo

scripts

A bunch of scripts, some to be moved to their own repository
commit: 6a2030d10ed2a8b4d4605a8fc8a3bbc9986a1b0e
parent: b835c40d01b7993341a7ab04f3f27cdd2178a1d6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 11 Oct 2018 16:52:53 +0200

shell/fediverse/peers.sh: New script

Diffstat:

Ashell/fediverse/peers.sh17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/shell/fediverse/peers.sh b/shell/fediverse/peers.sh @@ -0,0 +1,17 @@ +#!/bin/sh +home_instance="https://queer.hacktivis.me" +instances_peers=$(curl -sSL "${home_instance}/api/v1/instance/peers" | jq -r .[]) + +for instance in $instances_peers +do + echo -n " +${instance}:" + host -t A "${instance}" | grep 'has address' >/dev/null 2>&1 && echo -n ' A' + host -t AAAA "${instance}" | grep 'has IPv6' >/dev/null 2>&1 && echo -n ' AAAA' + # [ -z "$(dig +short ${instance} A 2>/dev/null)" ] || echo -n ' A' + # [ -z "$(dig +short ${instance} AAAA 2>/dev/null)" ] || echo -n ' AAAA' + ping -4 -c 3 "${instance}" >/dev/null 2>&1 && echo -n ' ICMPv4' + ping -6 -c 3 "${instance}" >/dev/null 2>&1 && echo -n ' ICMPv6' + curl -4 -sSL "https://${instance}/" >/dev/null 2>&1 && echo -n ' HTTPSv4' + curl -6 -sSL "https://${instance}/" >/dev/null 2>&1 && echo -n ' HTTPSv6' +done