Re: [webmin-l] How to create interactive dialogue in Custom Commands?
"Jamie Cameron" <[email protected]>
| Newsgroups | gmane.comp.web.webmin.general |
|---|---|
| Message-ID | <[email protected]> |
Currently, there is no way to do this, sorry. The custom command is just run with whatever input is gathered from the parameters, and the output is displayed. True interactivity would be much more complex, as it requires running an interactive shell in the browser. On 11/Feb/2017 14:25 dl <[email protected]> wrote .. Reading here ... http://doxfer.webmin.com/Webmin/Command_Shell. "The module's biggest limitation is that interactive commands like vi, passwd and telnet cannot be run. There is no support for providing input to a command once it has started, so you are limited to non-interactive programs like cp, ls and rm." Now I'm creating a repository of Custom Commands (having cloned that module) and I would like to have some interactivity (dialogue) in some commands, such as offered in whiptail. Here is one writeup on using whiptail .. http://www.techrepublic.com/blog/linux-and-open-source/how-to-use-whiptail-to-write-interactive-shell-scripts/ I've tried various permutations of Custom Command but I'm not there yet. So is there a wa y of writing a Custom Command which launches whiptail shell scripts which can in turn launch an interactive dialogue window? Another approach I'm trying is launching a python wrapper which launches a whiptail script using subprocess method. Here is an example whiptail script. whiptail_example.sh #! /bin/bash OPTION=$(whiptail --title "Test Menu Dialog" --menu "Choose your option" 15 60 4 \ "1" "Grilled Spicy Sausage" \ "2" "Grilled Halloumi Cheese" \ "3" "Charcoaled Chicken Wings" \ "4" "Fried Aubergine" 3>&1 1>&2 2>&3) exitstatus=$? if [ $exitstatus = 0 ]; then echo "Your chosen option:" $OPTION else echo "You chose Cancel." fi # http://xmodulo.com/create-dialog-boxes-interactive-shell-script.html Thanks. dl ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot - 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