Created
July 10, 2014 14:02
-
-
Save midwire/ef12378d4b930eb3e5a8 to your computer and use it in GitHub Desktop.
TOR service control script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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