...
# Call 1. Uses the ftp command with the -inv switches.
#-i turns off interactive prompting.
#-n Restrains FTP from attempting the auto-login feature.
#-v enables verbose and progress.
ftp -inv invp $HOST << EOF
# Call 2. Here the login credentials are supplied by calling the variables.
...