#!/bin/bash # # Run in users/steve to reshuffle Songs, Fiction, etc. # # Move Songs -> Lyrics and make new Songs if necessary # if [ ! -d Lyrics ]; then mv Songs Lyrics mkdir Songs fi # Move Fiction -> Lit; Non-Fiction -> Doc if [ ! -d Lit ]; then mv Fiction Lit ln -s Lit Fiction fi if [ ! -d Doc ]; then mv Non-Fiction Doc ln -s Doc Non-Fiction fi # Reshuffle contents of Lyrics: make song subdirectories # song.html becomes Songs/song/lyrics.html; gets a symlink to index.html # both are incorrect, but they'll do for now. cd Lyrics for f in *.flk; do song=`basename $f .flk` if [ -f $song.html ]; then mkdir ../Songs/$song mv $song.html ../Songs/$song/lyrics.html (cd ../Songs/$song; ln -s lyrics.html index.html) [ -f $song.pdf ] && mv $song.pdf ../Songs/$song [ -f $song.ogg ] && mv $song.ogg ../Songs/$song [ -f $song.mp3 ] && mv $song.mp3 ../Songs/$song fi done