FTP script - 'quit' never executes

I have wrote a script to get a very large encrypted file from a remote ftp server to a local debian box.
The file downloads successfully, but the script never exits, or quits. None of code executes after the ftp get command.
The file is approx 291M

Here is the code:

!/bin/sh
WORKING_DIR=/home/jstrahm/AgencyWorks
LOG=$WORKING_DIR/log.txt
PGP_FILE=AiData.zip.pgp
AGWORKS_USER=xxxx
AGWORKS_PASWD=xxxx
AGWORKS_FTP="xxxxxx.com"

echo "`date` --BEGIN Get Replicator File" >> $LOG
# (1) Download the AgencyWorks encrypted zip file from Agency Works
ftp -niv $AGWORKS_FTP >> $LOG <<END_SCRIPT
quote USER $AGWORKS_USER
quote pass $AGWORKS_PASWD
binary
lcd $WORKING_DIR
get $PGP_FILE
quit
END_SCRIPT
echo "`date` --END Get Replicator File" >> $LOG
exit 0

You can try
close command instead of quit
then you can issue bye command

Thank you for the suggestion. I did try it, but the same results; nothing after the get command is executed.:slight_smile:

I noticed that even though the file completely downloads from the FTP Server, the FTP Server never replies with the 226 code of "Transfer Complete"

Could this be an issue with the FTP Server or my FTP Client?