|
@@ -48,6 +48,43 @@ else { echo '<meta http-equiv="refresh" content="120">'; $slowrefresh= true; }
|
|
|
|
|
|
?>
|
|
|
|
|
|
+<?php
|
|
|
+
|
|
|
+ // poll ADEI values at 60 sec interval
|
|
|
+ $lastRunLog = 'lastrun.log';
|
|
|
+ $lastRun = 0;
|
|
|
+ if (file_exists($lastRunLog)) {
|
|
|
+ $lastRun = file_get_contents($lastRunLog);
|
|
|
+ }
|
|
|
+ if (time() - $lastRun >= 60) {
|
|
|
+ file_put_contents($lastRunLog, time());
|
|
|
+
|
|
|
+ // fork process
|
|
|
+ umask(0);
|
|
|
+ $pid = pcntl_fork();
|
|
|
+
|
|
|
+ if ($pid < 0) {
|
|
|
+ print('fork failed');
|
|
|
+ exit(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($pid == 0) {
|
|
|
+ // child process -- only do data polling
|
|
|
+ $sid = posix_setsid();
|
|
|
+ if ($sid < 0) exit(2);
|
|
|
+
|
|
|
+ include('poll_adei_data.php');
|
|
|
+ include('poll_HV_data.php');
|
|
|
+
|
|
|
+ exit(0);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // parent process -- continue building website
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+?>
|
|
|
+
|
|
|
</head>
|
|
|
<body style="background-color:white;">
|
|
|
|