emptyTrash.sh 515 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. # Read the list of section numbers
  11. SECTIONS="`curl --silent 'http://localhost:32400/library/sections' | \
  12. grep '<Directory ' | sed 's%^.* key="\([0-9]*\)".*$%\1%'`"
  13. # Empty the trash for each section
  14. for i in $SECTIONS; do
  15. curl --silent --upload-file /dev/null "http://localhost:32400/library/sections/${i}/emptyTrash"
  16. done