Created
July 30, 2014 20:11
-
-
Save anonymous/c714a58b2c7cebc1b051 to your computer and use it in GitHub Desktop.
This file contains 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/sh -ex | |
# https://collector.torproject.org/archive/relay-descriptors/server-descriptors/server-descriptors-YYYY-MM.tar.xz | |
basename=`basename "$1" .tar.xz` | |
test -d "$basename" || tar xJf "$1" | |
grep -Elr '^router .* (50\.7|204\.45)\.' "$basename" > "$basename.descriptors" | |
xargs grep -l '^router Unnamed ' < "$basename.descriptors" > "$basename.descriptors.unnamed" | |
xargs grep -l '^platform Tor 0\.2\.4\.18-rc' < "$basename.descriptors.unnamed" > "$basename.descriptors.unnamed-v18" | |
xargs grep -h '^fingerprint ' < "$basename.descriptors.unnamed-v18" | | |
cut -d ' ' -f 2- | tr -d ' ' | | |
sort -u > "$basename.fingerprints.unnamed-v18" | |
xargs grep -h '^router ' < "$basename.descriptors.unnamed-v18" | | |
cut -d ' ' -f 3 | | |
sort -u > "$basename.ipaddresses.unnamed-v18" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment