A crude way with php is have a page that when it opens it runs the required
script via the shell_exec command.
Obviously if you are running inside the GUI you would need to add the admin
rights check.
Next add the script.sh file to do what you want.
The 'echo' would display the results when the page opens.
I can't remember the permissions on the .sh file , but this is easy to play
with to get it working.
You would have to edit the /etc/sudoers file to add the ability to run the
file by all.
This maynot be needed or change to username admin, I've only used this to
copy files on a public site.
Add something like the following to the suders file.
username ALL = NOPASSWD: /path/to/file/script.sh
Finally you would need to add a page in the GUI with links opening the php
pages that run the file(s)
Best Regards,
Howie.
The following is the php needed to check for admin user and then the 2 line
code for running the script.
<?php
include("ServerScriptHelper.php");
include_once("Product.php");
$serverScriptHelper = new ServerScriptHelper();
if (!$serverScriptHelper->getAllowed('adminUser')) {
header("location: /error/forbidden.html");
return;
}
$factory =
$serverScriptHelper->getHtmlComponentFactory("dincom-munin");
$page = $factory->getPage();
echo $page->toHeaderHtml();
$serverScriptHelper->destructor();
$output = shell_exec('./script.sh');
echo "<pre>$output</pre>";
?>
-----Original Message-----
From: Kenneth Allan [mailto:kenneth (at mark) domain-nameit.net]
Sent: 21 November 2007 22:09
To: coba-e (at mark) bluequartz.org
Subject: [coba-e:11208] GUI interface for basic commandline commands?
Hi Blues,
Has anyone created a simple BQ GUI interface for the actual basic
commandline commands?
ie; restarting apache, email etc etc ...other functions
This would be very handy on production machines with heavy loads.
Best regards,
Kenneth