plait-s3 592 B

1234567891011121314151617181920
  1. #! /bin/bash
  2. source $HOME/.plait/config
  3. export S3DIR="/mnt/s3/music"
  4. export BASEURL=http://$AWS_S3_BUCKET.s3.amazonaws.com/music
  5. echo "PLATFORM=any-s3" > $HOME/.plait/s3-config
  6. echo "MUSICDIR=$S3DIR" >> $HOME/.plait/s3-config
  7. echo "BASEURL=$BASEURL" >> $HOME/.plait/s3-config
  8. echo Building local play list...
  9. plait > /dev/null --platform any-listonly "$@"
  10. echo Syncing music files to S3...
  11. awk -f $INSTALLDIR/share/plait/treecopy.awk d="$MUSICDIR/" to="$S3DIR/" "$HOME/.plait/playlist.m3u" | sort -u | sh
  12. echo Building remote play list...
  13. plait --guest s3 --cache
  14. plait --guest s3 "$@"