Compatible with DokuWiki
DokuWiki 2009-02-06+
This plugin executes a program on the fly and shows its output.
You can use it to generate reports from the system or to execute some administration steps.
For example, I use it to collect information from my enterprise servers (free space on disks, hardware status, etc.)
It's quite easy:
Syntax is simple:
<runcommand>
command|<command>
outputType|<output type>
runButtonText|<run button label>
cancelButtonText|{ <cancel button label> | none }
<arg-1 label>|<arg type>=<arg value>
…
<arg-n label>|<arg type>=<arg value>
</runcommand>
Where:
Example:
In this example, I use the printf command to show the values of arguments.
<runcommand>
command|printf "==== Test ====\n\n__Result__\n\n * arg1=**$arg_1**\n * arg2=//$arg_2//\n * arg3=$arg_3\n\n <note>Work</note>"
cancelButtonText|{ <cancel button label> | none }
arg 1|text=argument 1
arg 2|hidden=argument 2
arg 3|list=item 1:value 1;item 2:value 2;item 3:value 3;default:item 2
</runcommand>
In this example I use the printf command to show the values of arguments without display the cancel button and with custom label for run button
<runcommand> command|printf "==== Test ====\n\n__Result__\n\n * arg1=**$arg_1**\n * arg2=//$arg_2//\n * arg3=$arg_3\n\n <note>Work</note>" runButtonText|Test Me cancelButtonText|none outputType|wiki arg 1|text=argomento 1 arg 2|text=argomento 2 arg 3|list=item 1:value 1;item 2:value 2;item 3:value 3;default:item 2 </runcommand>
From wiki configuration's page you find five fields dedicated to runcommand.
Actually, runcommand supports only Italian and English languages. I'm really happy if anyone could contribute to the translation in other languages… ;)
Write here if you find a bug.
Some points to consider:
postaction.php– Chris Usher
<?php /** * French language file * * @author Alessandro Celli <aelsantex@gmail.com> * @author Etienne M. <emauvaisfr@yahoo.fr> */ // custom language strings for the plugin $lang['btn_submit'] = 'Exécuter'; $lang['btn_reset'] = 'Effacer'; $lang['lbl_outputFormat'] = 'Format de sortie '; $lang['fld_text'] = 'Texte'; $lang['fld_wiki'] = 'Wiki'; $lang['fld_html'] = 'Html'; $lang['msg_wrongsyntax'] = 'Mauvaise syntaxe pour le plugin runcommand.';
<?php /** * French language file * * @author Alessandro Celli <aelsantex@gmail.com> * @author Etienne M. <emauvaisfr@yahoo.fr> */ // for the configuration manager $lang['safe_scripts'] = 'N\'exécuter que les scripts présents dans le dossier des scripts autorisés.'; $lang['script_dir'] = 'Dossier qui contient les scripts autorisés (à partir de la racine du dokuwiki).';
Hi Etienne, many thanks, I have included your translation but now I have introduced other 3 parameters. Can you help me to translate that?
Can you give a simple script to test?
I can not use this plug-in :S
Ok, a little example for linux/unix users.. Save the follow script into scripts directory as printf with execution permissions (rwxr–r–) and try to use given examples:
#!/bin/bash printf "$*\n"