Last active
August 29, 2015 14:00
-
-
Save jameshilliard/11094016 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Net::SSH.start(ipaddress, "root", :password => "root") do |ssh| | |
puts "reloading network interface" | |
begin | |
Timeout::timeout(network_reload_timeout) do | |
ssh.exec!("/etc/init.d/network reload") | |
end | |
rescue Timeout::Error | |
puts "connection closed from network change" | |
ssh.shutdown!() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment