mediaPath 499 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # Run silent, run deep
  3. SILENT=0
  4. if [ "`basename "${0}"`" == 'isMediaMounted' ]; then
  5. SILENT=1
  6. fi
  7. # Exit cleanly if the TV path exists
  8. MEDIA="${HOME}/media"
  9. if [ -d "${MEDIA}/TV" ]; then
  10. if [ $SILENT -le 0 ]; then
  11. echo -n "${MEDIA}"
  12. fi
  13. exit 0
  14. fi
  15. # If we didn't find anything attempt to mount
  16. MOUNT="${HOME}/bin/video/mountMedia"
  17. if [ -x "${MOUNT}" ] && [ -z "${MEDIA_MOUNTING}" ]; then
  18. "${MOUNT}"
  19. fi
  20. # Fail even if the mount succeeds, so that children can see the error
  21. exit 1