#!/bin/sh

#. /usr/local/bcnu/etc/bcnuenv
. $BCNUHOME/agent/agent_head

for param in $BCNUPARAM
do
	bcnu_param
#set -x
	FTPHOST=$p1
	FTPID=$p2

if $BCNUHOME/custom/autoftp $FTPHOST $FTPID >$BCNUTMP/ftpdir.out 2>&1
	then
		BCNUMSG="$BCNU -h $FTPHOST -m 'ok - ftp operational' -f $BCNUTMP/ftpdir.out -e $BCNU_OK $BCNUHOST"
		bcnu_send
	else
		BCNUMSG="$BCNU -h $FTPHOST -m 'error - ftp output not as expected' -f $BCNUTMP/ftpdir.out -e $BCNU_ERR $BCNUHOST"
		bcnu_err_send
fi
done
