Skip to content

Instantly share code, notes, and snippets.

@midwire
Created July 10, 2014 14:02
Show Gist options
  • Select an option

  • Save midwire/ef12378d4b930eb3e5a8 to your computer and use it in GitHub Desktop.

Select an option

Save midwire/ef12378d4b930eb3e5a8 to your computer and use it in GitHub Desktop.
TOR service control script
#!/usr/bin/env bash
cmd=$1
function start_tor() {
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.tor.plist
}
function stop_tor() {
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.tor.plist
}
case $cmd in
start )
start_tor
;;
stop )
stop_tor
;;
restart )
stop_tor
start_tor
;;
status )
ps aux|grep '/usr/local/opt/tor/bin/tor'|grep -v 'grep'
;;
* )
echo "Usage: $0 [status, start, stop, restart]"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment