forked from atkphpframework/achievo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runcron
37 lines (32 loc) · 831 Bytes
/
runcron
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
if ($_SERVER["argv"][1]!="")
{
if (strpos($_SERVER["argv"][1], "/")!==false ||
strpos($_SERVER["argv"][1], "..")!==false ||
strpos($_SERVER["argv"][1], "\\")!==false)
{
echo "possible hack attempt. exiting.\n";
exit;
}
else
{
list($module, $script)=explode(".", escapeshellcmd($_SERVER["argv"][1]));
include_once("atk.inc");
include_once("achievotools.inc");
atksession("default", false);
$filename = moduleDir($module)."cron/".$script.".cron";
if (file_exists($filename))
{
include_once($filename);
}
else
{
echo "Cron script does not exist: $filename\n";
}
}
}
else
{
echo "usage: php runcron modulename.cronscriptname\n";
}
?>