Save this script under something like tor.sh in one of your sourced bin folders, make it executable with chmod + x and use it as a replacement for the general tor command. " echo "$( tput sgr0 )" # color reset tor " echo "$( tput setaf 136 )" # orange echo " Starting Tor. #Tor app connecting automatically update#In a nutshell, this shell script asks you for your admin password upfront, starts up Tor, and sets all required proxy network settings automatically: #! /usr/bin/env bash # '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 & # trap ctrl-c and call disable_proxy() function disable_proxy() trap disable_proxy INT # Let's roll sudo networksetup -setsocksfirewallproxy $ INTERFACE 127.0.0.1 9050 off sudo networksetup -setsocksfirewallproxystate $ INTERFACE on echo "$( tput setaf 64 )" # green echo " SOCKS proxy 127.0.0.1:9050 enabled. So I extended it a bit to make it more user friendly. I’ve found a nice script for this but running it opened multiple admin password prompts. Thankfully macOS provides a way to programmatically set those proxy values via the networksetup utility. When you’re already in the Terminal to start up Tor, additionally setting the network settings involves a lot of fiddling around. #All in one go: start Tor & set network proxy settings automatically Note that you have to repeat those steps for every other network interface if you use, say, Wi-Fi and Ethernet interchangeably. Switching to the Tor location routes all network traffic on your system through Tor.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |