Skip to content

Instantly share code, notes, and snippets.

@jameshilliard
Last active August 29, 2015 14:00
Show Gist options
  • Save jameshilliard/11094016 to your computer and use it in GitHub Desktop.
Save jameshilliard/11094016 to your computer and use it in GitHub Desktop.
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