0

I need to run a fairly complicated installer.sh script that, when ran, asks you all kinds of questions via dialog command which involve typing, multiple choice, checkboxes.

I need to run this installer on many, many, many machines. I'm trying to think of a way to write a simple ruby script to SSH into a server, run the command, but then use code to programmatically answer the questions when "prompted". I would write/handle what answers to put in my ruby code.

Is this possible?

The only caveat I can think of is it does 4 minutes of installing before asking for prompts. Ideally the script could detect 'am I being prompted?' and then answer right away so my ruby code would be systematic like...

1. <up><enter>
2. password<enter>
3. <space><enter>

I am also open to other methods of doing it...

I can't really "unwrap" the installer as it is just so complicated, I really just have to go through the prompts.

I have thought about provisioning images like in AWS... but the host I must use does not support images.

Tallboy
  • 12,847
  • 13
  • 82
  • 173
  • https://stackoverflow.com/questions/7142978/is-there-an-expect-equivalent-gem-for-ruby – mashuptwice Apr 25 '22 at 02:03
  • Ruby has limited support for Expect-like interactions via the pty and open3 modules, but using Expect directly or via scripts and system commands is often more powerful. – Todd A. Jacobs Apr 25 '22 at 15:02

0 Answers0