Skip to content

Instantly share code, notes, and snippets.

@khws4v1
Created February 23, 2015 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khws4v1/846dec102c45adcff512 to your computer and use it in GitHub Desktop.
Save khws4v1/846dec102c45adcff512 to your computer and use it in GitHub Desktop.
Torの出口ノードのIPアドレスを表示するシェルスクリプト
#!/bin/sh
# Get tor exit address
data=`curl -s https://check.torproject.org/exit-addresses`
if [ $? -ne 0 ]; then
echo "Cannot get address."
exit 1
fi
echo "${data}" | grep "ExitAddress" | while read line
do
ip=`echo "${line}" | sed -e "s/^ExitAddress \([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*/\1/g"`
echo "${ip}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment