diff --git a/README.md b/README.md index 5c8cf423..d2982969 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Web based interface for controlling the Raspberry Pi Camera, includes motion detection, time lapse, and image and video recording. -Current version 6.0.12 +Current version 6.0.13 All information on this project can be found here: http://www.raspberrypi.org/forums/viewtopic.php?f=43&t=63276 The wiki page can be found here: diff --git a/www/config.php b/www/config.php index 90452770..d631d0db 100755 --- a/www/config.php +++ b/www/config.php @@ -3,7 +3,7 @@ define('LBASE_DIR',dirname(__FILE__)); //Global defines and utility functions // version string - define('APP_VERSION', 'v6.0.12'); + define('APP_VERSION', 'v6.0.13'); // name of this application define('APP_NAME', 'RPi Cam Control'); diff --git a/www/schedule.php b/www/schedule.php index aed0c1ae..6a2cf559 100644 --- a/www/schedule.php +++ b/www/schedule.php @@ -122,16 +122,14 @@ function isCli() { } return false; } - + function getSchedulePID() { $pids = array(); - exec("pgrep -f -l schedule.php", $pids); + exec("ps -ef | awk '$9==\"schedule.php\" {print $2}'", $pids); $pidId = 0; - foreach($pids as $pid) { - if (strpos($pid, 'php ') !== false) { - $pidId = strpos($pid, ' '); - $pidId = substr($pid, 0, $pidId); - break; + if (count($pids) > 0) { + if (is_numeric($pids[0])) { + $pidId = $pids[0]; } } return $pidId; @@ -637,13 +635,12 @@ function mainCLI() { writeLog("RaspiCam support started"); $captureStart = 0; $pipeIn = openPipe($schedulePars[SCHEDULE_FIFOIN]); - $lastDayPeriod = -1; - $cmdPeriod = -1; $lastOnCommand = -1; $timeout = 0; $timeoutMax = 0; //Loop test will terminate after this (seconds) (used in test), set to 0 forever while($timeoutMax == 0 || $timeout < $timeoutMax) { writeLog("Scheduler loop is started"); + $lastDayPeriod = -1; $pollTime = $schedulePars[SCHEDULE_CMDPOLL]; $slowPoll = 0; $managechecktime = time();