<?PHP

require_once("config.php");

if (!isset($_GET['start']) && !isset($_GET['stop']))
    return header('HTTP/1.0 400 Command not supported');

$out = array();

if (isset($_GET['stop']))
    $str = exec($path."/dimctrl --stop", $out, $rc);

if (isset($_GET['start']))
    $str = exec($path."/dimctrl --start '".$_GET['start']."'", $out, $rc);

if ($rc!=1 && $rc!=2)
    return header('HTTP/1.0 500 Execution failed [rc='.$rc."]");

print($rc);

if (isset($_GET['debug']))
{
    print("\n");
    print_r($out);
}

?>
