I need lftp to connect to a list of hosts from a list file which are in ip address format. Then, if a ftp server is up, log that address (and if possible, device type, in this case routers) to a text file. For the servers that are up, I need it to connect without any credentials given and then use find to map the directories and files, then output that data to a file named after the server address. I tried to write a for loop with ftp but it was unsuccessful. I think lftp going to be the best option for what I need to do.
cat list6.txt | lftp | grep connected > livehosts.txt
also:
for i [in LIST ]; do ftp; "echo welcome> *"; done > [IP Address].txt