Created
January 12, 2026 15:28
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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