Handling shell script prompts while calling shell on remote machine

115 views
Skip to first unread message

Pawan

unread,
May 25, 2011, 1:34:11 PM5/25/11
to Capistrano
Hi All,

I am using cap to call a push a script to remote which further
downloads another script from http link which can contain any number
of parameter prompt. But by running cap, the prompt waits, and if i
enter value and click enter, it does not move to next.

Is there any way to make this user interactive.


Thanks
Pawan

Lee Hambley

unread,
Feb 14, 2013, 7:02:47 AM2/14/13
to capis...@googlegroups.com

Not possible sorry. (Input goes to ypur local terminal which does not have a way to forward to the next cap hosts. "multi server automation tool". Change whatever scrip requires input not to require any, or to read from a config file

Sent from my Galaxy S3.

On 14 Feb 2013 11:27, "Eddie Du" <sj.e...@gmail.com> wrote:
I would like to know as well!

I'm writing some install scripts with some prompts - I thought default_run_options[:pty] = true is suppose to solve this but it didn't.

--
--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
---
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Donovan Bray

unread,
Feb 14, 2013, 11:13:57 AM2/14/13
to capis...@googlegroups.com
You can have a conversation and response per server by using the underlying net ssh subsystem. 

I avoid doing this like the plague but in some situations it's impossible to do it any other way. 

The following blog post presents a pattern that I've used a number of times to do things similar to what you want to do. 



On Feb 13, 2013, at 5:56 PM, Eddie Du <sj.e...@gmail.com> wrote:

I would like to know as well!

I'm writing some install scripts with some prompts - I thought default_run_options[:pty] = true is suppose to solve this but it didn't.

On Wednesday, May 25, 2011 1:34:11 PM UTC-4, Pawan wrote:

--

Jonathan Rochkind

unread,
Feb 14, 2013, 11:22:06 AM2/14/13
to capis...@googlegroups.com
Neat i had been wondering how to do that too-- but also, that blog post specifically suggests an improvement to the built in cleanup task, donovan did you ever or can you pull request this improvement for inclusion in cap distro, instead of it just sitting out on a blog post?
________________________________________
From: capis...@googlegroups.com [capis...@googlegroups.com] on behalf of Donovan Bray [donn...@gmail.com]
Sent: Thursday, February 14, 2013 11:13 AM
To: capis...@googlegroups.com
Subject: Re: [capistrano] Re: Handling shell script prompts while calling shell on remote machine

You can have a conversation and response per server by using the underlying net ssh subsystem.

I avoid doing this like the plague but in some situations it's impossible to do it any other way.

The following blog post presents a pattern that I've used a number of times to do things similar to what you want to do.

http://blog.perplexedlabs.com/2010/09/08/improved-deploycleanup-for-capistrano/


On Feb 13, 2013, at 5:56 PM, Eddie Du <sj.e...@gmail.com<mailto:sj.e...@gmail.com>> wrote:

I would like to know as well!

I'm writing some install scripts with some prompts - I thought default_run_options[:pty] = true is suppose to solve this but it didn't.

On Wednesday, May 25, 2011 1:34:11 PM UTC-4, Pawan wrote:
Hi All,

I am using cap to call a push a script to remote which further
downloads another script from http link which can contain any number
of parameter prompt. But by running cap, the prompt waits, and if i
enter value and click enter, it does not move to next.

Is there any way to make this user interactive.


Thanks
Pawan

--
--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com<mailto:capis...@googlegroups.com>
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com<mailto:capistrano+...@googlegroups.com> For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
---
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com<mailto:capistrano+...@googlegroups.com>.

Donovan Bray

unread,
Feb 14, 2013, 11:31:20 AM2/14/13
to capis...@googlegroups.com
Not my blog post; and I used to use that cleanup code but its slow, and gets linearly slower the more hosts you are deploying to so I eventually took it out. The default handling is good enough.

But I've used that pattern a number of times to accomplish other things like for each server enumerate the ip of an eth interface then push down a specific file that matched that ip to that specific host. (This was to push down IPSec tunnel configurations that were tied to the private interfaces not the public ones that I was sshing to via cap, so the internal ips were unknown to cap ergo the per server enumeration)
Reply all
Reply to author
Forward
0 new messages