#!/bin/csh -f

set loop = 1
set song = ""
if( -f /usr/tmp/choice) set song = `cat /usr/tmp/choice`

while($loop == 1) 
	set choice = `rand 1 18`
	if($choice != $song) set loop = 0
end

if (-f /usr/tmp/play.pid) /usr/bin/kill `cat /usr/tmp/play.pid` >& /dev/null
echo $choice >! /usr/tmp/choice
($play $sounds/tv/*.$choice.* &)  
exit 0 
