IP FTP

I

Itay Livni

The idea of this script is:
1. Download ftp file.
2. Mail to some user (have not done that yet (yes this is essentially
my first script)

I am trying to incorporate some error handling so the script needs
1. To test if machine has Internet connection
2. check if ip is connectected.

This is where i fail to understand why this does not work. The script
essentially just times out

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/ftp.rb:159:in
`initialize': Operation timed out - connect(2) (Errno::ETIMEDOUT)

in the terminal i get under 1 sec response times.

Thank you in advance



if Ping.pingecho(ipMainAddress, 2) == true then
ipAddress = ipMainAddress
elsif Ping.pingecho(ipBackUpAddress, 2) == true then
ipAddress = ipBackUpAddress
else
puts "Check the following 3 things: "
end

# ftp = Net::FTP.new(ipAddress)
#
# ftp.login(userId, passWord)
# ftp.getbinaryfile(fileName)
# ftp.close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top