-
-
Save jameshilliard/9e88dc9e107181f7da20 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(current_ip, "root", :password => "root", :paranoid => false) do |ssh| | |
puts "checking file integrity" | |
tmp_md5 = ssh.exec!(fw_latest_md5_command) | |
puts tmp_md5.inspect | |
if fw_latest_md5 == tmp_md5 | |
puts ssh.exec fw_upgrade_command do |ch, stream, data| | |
if stream == "Rebooting system..." | |
puts "Upgrade Complete" | |
ch.shutdown() | |
puts "Shutting Down" | |
break | |
puts "Shut Down" | |
else | |
puts "ERROR: #{data}" | |
end | |
end | |
else | |
puts "Firmware upload is corrupt" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment