Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Net::SSH.start(ip, 'ubuntu', keys: "mykey.pem" ) do |ssh|
  2. ssh.exec "sudo chmod +x /tmp/provision.sh"
  3. end
  4.  
  5. model Instance
  6.  
  7. def chmod
  8. start do |ssh|
  9. ssh.exec "sudo chmod +x /tmp/provision.sh"
  10. # other operations on ssh
  11. end
  12. end
  13.  
  14. private
  15.  
  16. def start
  17. Net::SSH.start(ip, 'ubuntu', keys: "mykey.pem" ) do |ssh|
  18. yield ssh
  19. end
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement