I use lftp -f file myself file being plain text file with your ftp commands, one command per line. Works well.