diff --git a/bin/tor.sh b/bin/tor.sh new file mode 100755 index 0000000..6ba2574 --- /dev/null +++ b/bin/tor.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# ###################################################################### +# Start Tor and switch the system-wide proxy settings in OS X +# ---------------------------------------------------------------------- +# Usage: +# just run tor.sh in Terminal, kill with ctrl + c +# ---------------------------------------------------------------------- +# loosely based on +# http://leonid.shevtsov.me/en/an-easy-way-to-use-tor-on-os-x +# ###################################################################### + +# 'Wi-Fi' or 'Ethernet' or 'Display Ethernet' +INTERFACE=Wi-Fi + +# Ask for the administrator password upfront +sudo -v + +# Keep-alive: update existing `sudo` time stamp until finished +while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & + +# Let's roll +sudo networksetup -setsocksfirewallproxy $INTERFACE 127.0.0.1 9050 off +sudo networksetup -setsocksfirewallproxystate $INTERFACE on +tor +sudo networksetup -setsocksfirewallproxystate $INTERFACE off diff --git a/brew.sh b/brew.sh index dab0e96..16cba45 100755 --- a/brew.sh +++ b/brew.sh @@ -20,4 +20,5 @@ brew install gpg2 brew install mysql brew install imagemagick brew install GraphicsMagick -brew install android \ No newline at end of file +brew install android +brew install tor