scan.sh 445 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # Bail if the media share isn't mounted
  3. if ! ~/bin/video/isMediaMounted; then
  4. exit 0
  5. fi
  6. # Bail if we are already scanning
  7. if ~/bin/video/pms/isScanning.sh; then
  8. exit 0
  9. fi
  10. # Scan, appending any parameters passed to us
  11. /Applications/Zach/Media/Plex\ Media\ Server.app/Contents/MacOS/Plex\ Media\ Scanner --scan ${@}
  12. # Check the return; kill the PMS if things did not go well
  13. if [ $? -ne 0 ]; then
  14. ~/bin/video/pms/killPMS.sh
  15. fi