Re: [webmin-l] Custom commands .. responding to interactive dialogue
dl <[email protected]>
| Newsgroups | gmane.comp.web.webmin.general |
|---|---|
| Message-ID | <[email protected]> |
Just to complete this thread I tried using "expect" and "expect-lite" in
bash scripts but settled for pexpect.
http://pexpect.readthedocs.io/en/latest/install.html
The pexpect python script is made executable and runs as custom command.
regex is used in python script to find patterns in the questions
returned to terminal.
./test.py
One problem I had was finding the correct Tcl syntax to emulate
arrowdown and arrowup pressing
but I used this ... child.sendline('\E\[B')
child.send('\r') ... emulates pressing ENTER.
On 04/07/16 11:02, dl wrote:
>
>
> On 04/07/16 10:46, Jamie Cameron wrote:
>> There's no built-in support for handling interactive dialogs like this in Webmin.
>> Maybe if some other tool can fake it (ie. expect) you could call that from your
>> custom command though.
>
> Thanks.
>
> I did find this article which refers to expect .. which I will try.
>
> https://www.linux.com/news/command-line-automation-expect-lite
>
> I might also try running a python proxy script.
>
> DL*
> *
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
>
>
> -
> Forwarded by the Webmin mailing list at [email protected]
> To remove yourself from this list, go to
> http://lists.sourceforge.net/lists/listinfo/webadmin-list
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
-
Forwarded by the Webmin mailing list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-list