#!/bin/sh 
# by G.Landais (CDS) 07/06/2013

# Execute copy FTP (which execute the script ./convert)
#	copy remote file (get astorb.html astorb.txt astorb.dat.gz)
#       execute ./convert : 
#            1) convert astorb.dat
#            2) compare # of lines between new and old files
#                exit if no change
#            3) modify ReadMe and .Summary with the new number of lines
#            4) Run anafile
#               if errors: exit 1 and print message
#            5) Execute astorb command
#            6) move some astorb files
#            7) Print messageto execute Makefile
#
# RETURN 0: nothing change
#        1: error
#        2: change is needed

# get files
cd $HOME/pftp ; 
cmp $0 astorb/update_copy || echo "#***Attention, $0 != astorb/update_copy"
./copy copyP.ftp.lowell.edu
if [ $? -ne 0 ]; then
    exit 1
fi

#!printenv ; echo '###############################'; echo ""
cd astorb; ls -la ; echo ""
echo ""; pwd; echo ""
./convert
exit $?
