1
0
mirror of https://github.com/kremalicious/dotfiles.git synced 2024-12-22 09:13:22 +01:00

Tor setup for OS X

This commit is contained in:
Matthias Kretschmann 2015-07-26 20:38:40 +02:00
parent 4a261456bc
commit 95acd46540
2 changed files with 28 additions and 1 deletions

26
bin/tor.sh Executable file
View File

@ -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

View File

@ -20,4 +20,5 @@ brew install gpg2
brew install mysql
brew install imagemagick
brew install GraphicsMagick
brew install android
brew install android
brew install tor