3 ## Originally written by Peter Palfrader.
5 ## This script lets you quickly check if a given router (by nickname)
6 ## will let you do a TLS handshake, or will let you download a directory.
8 ## Usage: check-tor nickname
13 dirserver
="http://belegost.seul.org:80/tor/"
15 lines
=$
( wget
-q $dirserver --proxy=off
-O - |
grep -A5 '^router '"$router"' ' )
16 line
=$
( echo "$lines" |
head -n1 )
18 if [ -z "$line" ]; then
26 ipor
=$
( echo "$line" |
awk '{printf "%s:%s", $3, $4}' )
28 op
=$
( echo "$line" |
awk '{printf $6}' )
29 ipop
=$
( echo "$line" |
awk '{printf "%s:%s", $3, $6}' )
32 echo ">>" openssl s_client
-connect "$ipor"
33 timeout
5 openssl s_client
-connect "$ipor" < /dev
/null
34 if [ "$op" != "0" ]; then
36 echo ">>" wget
--proxy=off
-O - http
://$ipop/tor
/
37 timeout
5 wget
--proxy=off
-O - http
://$ipop/tor
/ |
head -n3
41 echo -n "$router "; echo "$lines" |
grep 'fingerprint' |
sed -e 's/^opt //' -e 's/^fingerprint //';