[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] System Script via UI



Hi Alan,

> Anyone have any insight to running "system scripts" from the Cobalt UI
> on a RAQ 550. Assumed it would be fairly straight forward looking at
> some php files provided with the system, but I am clearly missing
> something.

Like Robert said, the proper way is to do it throug CCE by triggering the 
handlers.

If you just want to call an external script or programm from inside a PHP 
script and it's sufficient that this is done as user httpd and group httpd, 
then you can use the following PHP code:

$fp = popen('/usr/bin ls -la /tmp', 'r');
while(!feof($fp)) {
        $answer = fgets($fp,300);
}
pclose($fp);

But as said, it'll run as user httpd and group httpd, so it's usually not 
sufficient in cases where you want to read or write to config files.

-- 

With best regards,

Michael Stauber
mstauber@xxxxxxxxxxxxxx
Unix/Linux Support Engineer