checkTorrent 377 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 the load is high
  6. if ! ~/bin/video/checkLoad.sh; 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