123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- v3authority="http://tor.noreply.org/tor/status-vote/current/consensus";
- v2authority="http://tor.noreply.org:80/tor/status/authority";
- authority=$v2authority;
- function usage {
- echo "Usage: $0 [-2|-3] nodenickname";
- }
- if [ -z "$1" ];
- then
- usage;
- exit;
- fi
- if [ "$1" == "-2" -o "$1" == "-3" ];
- then
- if [ "$1" == "-2" -a -n "$2" ];
- then
- authority=$v2authority;
- nickname="$2";
- elif [ "$1" == "-3" -a -n "$2" ];
- then
- authority=$v3authority;
- nickname="$2";
- else
- usage;
- exit;
- fi
- else
- nickname="$1";
- fi
- fp=`wget -q -O - $authority | \
- awk '$1 == "r" && $2 == "'$nickname'" {printf "%s===", $3}' | \
- perl -MMIME::Base64 -e "print unpack(\"H*\", decode_base64(<>)),\"\n\"";`
- if [ "$fp" != "" ];
- then
- wget -q -O - http://tor.noreply.org:80/tor/server/fp/$fp;
- exit $?;
- else
- echo "It appears the nickname is not currently known by the directory" \
- "authority."
- exit 1;
- fi
|