#!/bin/sh
echo 'trying to compile maild.cpp...'
echo 'g++ mailnotd.cpp -o mailnotd'
if (g++ mailnotd.cpp -o mailnotd) then
   echo '...done!'
   echo 'copying maild to /usr/bin...'
   if (cp ./mailnotd /usr/bin)then
       echo '...done!'
       cp ./maild /usr/bin
       echo 'copying ./box.xpm /usr/bin'
       if(cp box.xpm /usr/bin)then
       echo '...done!'
       echo 'Installation Completed!'
       echo
       echo 'Refer to the README to learn more about maild 0.1!'
       exit 0
       fi 
   fi
   echo 'Could not write to /usr/bin'
   echo 'You should be able to do this yourself.'
   echo 'If not, please ask your Sysadmin for help'
   exit 1
fi
echo 'ERROR: could not compile maild.cpp... exiting!'
exit 1
