#! /bin/csh -f
#set echo

setenv DJINN_RC_PATH /design/djinn/icc

set address = <your-email-id-here>
        
# Note- the numerical IP address for www.chessclub.com is required for 
# timestamp to work correctly?!?!  -- Yeesh!!

# Extract the date
set date = `/bin/date | awk '{ print $3 "-" $2 "-" $6}' | tr "[A-Z]" "[a-z]"`

xboard -size large -geometry +300-150 -sgf ics-games.${date}.pgn \
-fcp "./DjinnX -ics whisper" -fd /design/djinn/icc \
-ponder -thinking -xexit -popupExitMessage false \
-ics -zp -autoflag -icshost 204.178.125.65 -icshelper /usr/bin/timestamp

if (1 == $#argv) then
    echo "Sending mail to $address"
    set subject = "ICS Computer chess games for ${date}"
    cat ics-games.${date}.pgn | mail -s "$subject <sent by mail>" $address
endif

