0

Inside my ruby script I need to run a script sh which is located in another machine (opening an ssh connection?) and then continues with my program. So:

  • my ruby script (e.g: Machine 10.1.1.2)

    generic command
    generic command ...
    RUN SCRIPT UPDATE.SH ON MACHINE 10.1.1.15
    generic command
    generic command

user3472065
  • 1,259
  • 4
  • 16
  • 32
  • What do you have so far? – Russell Uhl Jun 03 '14 at 12:48
  • I'm trying to understand if it is feasible and how can I do that. So, now I have nothing concrete. I think I need to use Net::SSH or something similar... but no idea, this is the first time – user3472065 Jun 03 '14 at 12:52
  • 1
    I don't know anything at all about Ruby, but I do know it's certainly easy to remotely execute a command. Even if you have to do something stupid like make a system call, rather than using some built-in functionality ruby has, it shouldn't be too difficult: http://stackoverflow.com/questions/305035/how-to-use-ssh-to-run-shell-script-on-a-remote-machine – Russell Uhl Jun 03 '14 at 12:57
  • on what OS are you ? there are command line utilities like psexec.exe on windows to do that – peter Jun 03 '14 at 13:43
  • Have you seen sshkit? https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md – Jozsef NYITRAI Jun 03 '14 at 13:46

0 Answers0