Hi,
I have this slightly modified FTP code (thanks to this forum)
function gather_FTPDate {
HOST=
USER=
PASSWD=
exec 4>${TEMP_LOG_FILE}
ftp -nv >&4 2>&4 |&
echo $?
if [[ $? -ne 0 ]] then
echo "Unable to connect to FTP server!!!" >> ${LOG_FILE}
return 0
fi
print -p open $HOST
print -p user $USER $PASSWD
...
print -p bye
wait
}
The problem is with the if loop. How do i check if the connection to the FTP server is a success or failure? Even when the connection times out, i get a return code of 0.
Thanks.