#!/bin/sh
echo "starting fitsverify_delivery"
date

fitsverify *.fits > fitsverify.out
if [ `grep -i 'ERRORS were encountered' fitsverify.out | wc -l` -gt 0 ]
then
   echo "errors in fitsverify"
   echo "see output file fitsverify.out"
   exit 1
else
 if [ `grep -i 'WARNINGS were encountered' fitsverify.out | wc -l` -gt 0 ]
 then
   echo "warnings in fitsverify"
   echo "see output file fitsverify.out"
   exit 0
 else
   echo "no errors or warnings reported by fitsverify"
   echo "created output file fitsverify.out"
   exit 0
 fi
fi


