Guest User

Untitled

a guest
Feb 13th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. require 'rubygems'
  2. require 'net/ssh'
  3.  
  4. host = "abc.de"
  5. user = "user_xy"
  6. pass = "user_pass"
  7.  
  8. begin
  9. Net::SSH.start(host, user, :password => pass) do |ssh|
  10. $a = ssh.exec! "cd xy_dir && php abc.phar do_this"
  11. ssh.close
  12. puts $a
  13. end
  14. rescue
  15. puts "Unable to connect to #{host}."
  16. end
Add Comment
Please, Sign In to add comment