Some fix
This commit is contained in:
parent
62003cb977
commit
c19a7d3249
|
@ -39,7 +39,6 @@ require_once("/usr/share/alternc/panel/class/config_nochk.php");
|
||||||
$LOCK_FILE='/var/run/alternc/do_actions_cron.lock';
|
$LOCK_FILE='/var/run/alternc/do_actions_cron.lock';
|
||||||
$SCRIPT='php do_actions';
|
$SCRIPT='php do_actions';
|
||||||
$MY_PID=getmypid();
|
$MY_PID=getmypid();
|
||||||
$BACKUP_DIR='/var/backup/alternc/';
|
|
||||||
|
|
||||||
// Check if script isn't already running
|
// Check if script isn't already running
|
||||||
if (($PID=file_get_contents($LOCK_FILE)) !== false){
|
if (($PID=file_get_contents($LOCK_FILE)) !== false){
|
||||||
|
@ -64,11 +63,11 @@ if (file_put_contents($LOCK_FILE,$MY_PID) === false){
|
||||||
//We get the next action to do
|
//We get the next action to do
|
||||||
while ($r=$action->get_action()){
|
while ($r=$action->get_action()){
|
||||||
// We lock the action
|
// We lock the action
|
||||||
$action->begin($r[id]);
|
$action->begin($r["id"]);
|
||||||
// We process it
|
// We process it
|
||||||
$params=array($r["parameters"]);
|
$params=$r["parameters"];
|
||||||
// We exec with the specified user
|
// We exec with the specified user
|
||||||
exec("su ".$params["user"]);
|
exec("su ".$r["user"]);
|
||||||
switch ($r["type"]){
|
switch ($r["type"]){
|
||||||
case "CREATE_FILE" :
|
case "CREATE_FILE" :
|
||||||
$return=file_put_contents($params["file"],$params["contents"]);
|
$return=file_put_contents($params["file"],$params["contents"]);
|
||||||
|
|
Loading…
Reference in New Issue