-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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