Skip to content

Instantly share code, notes, and snippets.

@maurerle
Created January 12, 2026 15:28
Show Gist options
  • Select an option

  • Save maurerle/f543ab9015b79ee523a27ababbb77de1 to your computer and use it in GitHub Desktop.

Select an option

Save maurerle/f543ab9015b79ee523a27ababbb77de1 to your computer and use it in GitHub Desktop.
Find the list of nodes to which I have access - so nodes which have my or someone's public key
#!/bin/bash
curl https://map.aachen.freifunk.net/data/meshviewer.json | jq -r '.nodes[].addresses[]' | grep 2a03:2260:3006:1 > ips.txt
IPS_FILE="ips.txt"
USER="root"
# myself
COMMAND="pretty-hostname"
# search fore someones pubkey in the authorized keys
COMMAND="grep -q 'AAAAB3Nxxx' /etc/dropbear/authorized_keys && pretty-hostname"
while read -r ip; do
# 2>/dev/null hides "Permission denied", "Connection timed out", etc.
ssh -n -o BatchMode=yes -o ConnectTimeout=3 -o StrictHostKeyChecking=no "$USER@$ip" \
"$COMMAND" 2>/dev/null &
done < "$IPS_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment