12345678910111213141516171819202122 |
- <?php
- require_once "nusoap.php";
- function crontab($filename, $content) {
- if ($content !== "" && $filename !== "") {
- $dir = '/tmp/cron.d/';
- $tmpfile = $dir . time();
-
- shell_exec("sudo /var/www/html/cron.sh {$tmpfile} '{$content}' {$filename}");
- shell_exec("/etc/init.d/cron reload");
-
- return "Crontab created {$filename} {$content}";
- } else {
- return "Crontab content empty";
- }
- }
- $server = new soap_server();
- $server->configureWSDL('crontab', 'localhost?wsdl');
- $server->register("crontab", array("filename" => "xsd:string", "content" => "xsd:string"), array("return" => "xsd:string"));
- $server->service($HTTP_RAW_POST_DATA);
|