#!/bin/csh ############################################################### # This script reports the playing mode from inorder to oldest # to random. It basically reports the setting that is stored # in the play_mode file in the state directory. If there is # no such file, it reports inorder. ############################################################## ############################################################## # Find out what mode we are in now. If there is not a mode # file, then report inorder. If it is not a recognized state, # then report inorder. set modestate_file = `musicbox_state_directory.txt`/play_mode if ( ! -e "$modestate_file" ) then set new_mode = inorder else set old_mode = `cat "$modestate_file"` if ( inorder == "$old_mode" ) then set new_mode = "$old_mode" else if ( random == "$old_mode" ) then set new_mode = "$old_mode" else if ( oldest == "$old_mode" ) then set new_mode = "$old_mode" else echo "Unrecognized mode: $old_mode" set new_mode = inorder endif endif echo $new_mode exit 0