#!/bin/csh ############################################################### # This script looks for a CD that has been read in but which # has never been linked to any directory. Ask the user what # to call it and then start playing it. ############################################################## set device = '/dev/cdrom' # Start out in the right place. cd `musicbox_cds_directory.txt` foreach cd ( `ls by_id` ) # See if we've already loaded this disc. If so, then # play it off the disc drive and eject the disc. set orphan = `ls -l ?/?/* | grep "$cd" | wc -l` if ( $orphan == 0 ) then # We have one to play, so stop any currently-playing songs. musicbox_kill_playing_jobs.txt ( musicbox_play.txt by_id/"$cd" >& /dev/null )& # We found one, so we're outta here. exit 0; endif end