From 38a68377a4588ef645ab4e3d9c16a1399b4f4e04 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Fri, 26 Apr 2013 09:53:48 +0000 Subject: [PATCH] Send mail on error now works --- src/do_actions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/do_actions.php b/src/do_actions.php index fb386640..951108b9 100644 --- a/src/do_actions.php +++ b/src/do_actions.php @@ -47,8 +47,8 @@ function d($mess){ // Function to mail the panel's administrator if something failed function mail_it(){ - global $error_raise; - mail("alterncpanel@$L_FQDN",'Cron do_actions.php failed!',$error_raise); + global $error_raise,$L_FQDN; + mail("alterncpanel@$L_FQDN",'Script do_actions.php issues',"\n Errors reporting mail:\n\n$error_raise"); } require_once("/usr/share/alternc/panel/class/config_nochk.php"); @@ -70,7 +70,7 @@ if (file_exists($LOCK_FILE) !== false){ exit(0); }else{ // Previous cron failed! - $error_raise.="No process with PID $PID found! Previous cron failed...\n"; + $error_raise.="Lock file already exists. No process with PID $PID found! Previous cron failed...\n"; d("Removing lock file and trying to process the failed action..."); // Delete the lock and continue to the next action unlink($LOCK_FILE); @@ -175,7 +175,7 @@ while ($rr=$action->get_action()){ } // If something have failed, notify it to the admin -if($error_raise === '') +if($error_raise !== '') mail_it(); // Unlock the script