checkTorrent 462 B

123456789101112131415
  1. #!/bin/bash
  2. # Absolute paths for torrent app and bin
  3. TORRENT_APP="/Applications/Zach/Internet/Transmission.app"
  4. TORRENT_BIN="${TORRENT_APP}/Contents/MacOS/Transmission"
  5. # Bail if WoW is running
  6. if ps auwx | grep -v grep | grep -q "World of Warcraft/World of Warcraft-64.app/Contents/MacOS/World of Warcraft-64"; then
  7. exit 0
  8. fi
  9. # Start the torrent app if it isn't running
  10. if ! ps auwx | grep -v grep | grep -q "${TORRENT_BIN}"; then
  11. open "${TORRENT_APP}"
  12. fi