Hi everyone,
I have to maintenance an old script unix (#!bin/sh) that get files from remote host by ftp.
There is a configuration file that contains a list of IP; the script reads this file, one line by line, and per each IP execute these commands:
echo "verbose on" > ftprap.cmd
echo "prompt " >> ftprap.cmd
echo "ascii" >> ftprap.cmd
echo "mget * " >> ftprap.cmd
echo "quit" >> ftprap.cmd
ftp $IP < $PATH/ftprap.cmd
The problem is: if one host is not connected or unreachable, the scripts is locked and is enabled to connect to the other hosts (and so to get their files).
I try to resolve this problem using �ping -w 2 $IP� the host before connecting but because of the firewall, there are some hosts that block the ping but consent ftp.
I've looked for a timeout to apply to the ftp command but I've not found it.
There is someone who could help me? Thanks.