Skip to content

Instantly share code, notes, and snippets.

@nickboldt
Last active December 31, 2015 03:58
Show Gist options
  • Select an option

  • Save nickboldt/7930742 to your computer and use it in GitHub Desktop.

Select an option

Save nickboldt/7930742 to your computer and use it in GitHub Desktop.
for a new downloaded zip of mp3s: rename (remove spaces), move from temp download folder to ~/Music, backup onto another server, unpack zip, create m3u, and launch w/ vlc
#!/bin/bash
usage ()
{
echo "Usage: $0 \"/path/to/some zipfile.zip\""
echo ""
exit 1;
}
if [[ $# -lt 1 ]]; then usage; fi
zip="$1"
filename="${zip/.zip/}"
filename="${filename##*/}"
filename="${filename// /_}"
#echo "$filename"
# move zip from ~/tmp to ~/Music_LOCAL/
mv "$zip" ${HOME}/Music_LOCAL/${filename}.zip
zip="${HOME}/Music_LOCAL/${filename}.zip"
# unpack zip into ~/Music_LOCAL/{zip}/
unzip $zip -d ${HOME}/Music_LOCAL/${filename}/
# create m3u
cd ${HOME}/Music_LOCAL/${filename}/
ls *.mp3 >> ${filename}.m3u
vlc ${HOME}/Music_LOCAL/${filename}/${filename}.m3u &
# copy to ~/Music/_ZIPS/ (NFS mounted drive on another server)
rsync -Pzrlt --rsh=ssh "$zip" ${HOME}/Music/_ZIPS/ &
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment