epheterson

quitTorrent

Sep 19th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Relevant: http://www.reddit.com/r/apple/comments/kjtjo/does_there_exist_a_program_to_do_an_event_upon/
  2.  
  3. Scroll to bottom to copy text without line numbers.
  4.  
  5. File: ~/Library/Scripts/quitTorrent.com (You will likely have to create the Scripts folder)
  6. -----START FILE HERE-------
  7. #!/bin/bash
  8.  
  9. # Detect if I'm on campus' wifi.
  10. # Quit Transmission so I don't anger them.
  11.  
  12. if [ `networksetup -getairportnetwork en1 | awk {'print $4'}` == "jefferson" ]; then
  13. killall Transmission
  14. fi
  15.  
  16. exit 0
  17. -----END FILE HERE-------
  18.  
  19. File: ~/Library/LaunchAgents/com.pheterson.quitTorrent.plist (Fill in your account)
  20. -----START FILE HERE-------
  21. <plist version="1.0">
  22. <dict>
  23. <key>Label</key>
  24. <string>com.pheterson.quitTorrent</string>
  25. <key>ProgramArguments</key>
  26. <array>
  27. <string>/Users/**YOUR ACCOUNT**/Library/Scripts/quitTorrent.com</string>
  28. </array>
  29. <key>WatchPaths</key>
  30. <array>
  31. <string>/Library/Preferences/SystemConfiguration</string>
  32. </array>
  33. </dict>
  34. </plist>
  35. -----END FILE HERE-------
Add Comment
Please, Sign In to add comment