This extension is designed to execute shell commands and display their output on DekiWiki. This extension is based onVivieny's Deki_Extension_for_PHP and needs at least DekiWiki 8.05. If you have any question, please open a new thread on the forum and send me a private message with the post link.
INSTALLATION
- Create two new folder /var/www/deki-hayes/config/extensions and /exec
- Copy to /var/www/deki-hayes/config/extensions the files DekiExt.php and IXR_Library.inc.php.txt as described at Vivieny's Deki_Extension_for_PHP
- Copy to /var/www/deki-hayes/config/extensions the attached files exec.php and shell.php
- Take ownership of all new files
- chown -R www-data:www-data /var/www/deki-hayes/config/*
- chown -R www-data:www-data /exec
- Go to Service managmenent in the Control Panel of your wiki
- Under Add Service, click on Remote, and configure:
- Type = Extension
- Description = Shell Output Extension
- URI = http://localhost/config/extensions/shell.php
- Status = Enabled
- Click on add service
- This extension will only execute executable files found at /exec folder. So you must create there any scripts you need to execute or create symlinks to any executable you want. For example:
ln -s /bin/ps /exec/ps
FUNCTIONS
shell.exec(program:str):xml
This function will execute the parameter program and display the command output on the wiki page. For example:
{{ shell.exec("ps") }}
will display something similar to
PID TTY TIME CMD
8523 ? 00:01:04 mono
14984 ? 00:00:00 apache2
14987 ? 00:00:00 apache2
14988 ? 00:00:00 apache2
14989 ? 00:00:00 apache2
15526 ? 00:00:00 apache2
15527 ? 00:00:00 apache2
15528 ? 00:00:00 apache2
15529 ? 00:00:00 apache2
15530 ? 00:00:00 apache2
15531 ? 00:00:00 apache2
15911 ? 00:00:00 ps
execExternal(program:str):xml
This function will display a link that will open a new window display the command output . For example:
{{ shell.execExternal("ps") }}
will display something similar to../../../../Deki_Wiki/Extensions/Is_It_Friday?#
ps