Skip to content

Commit

Permalink
Removing rrd_dir when rrdcached is being used
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveSkylark authored Jul 23, 2022
1 parent 018334a commit b18db6d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions map-poller.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,19 @@
if (is_dir($conf_dir)) {
if ($dh = opendir($conf_dir)) {
while (($file = readdir($dh)) !== false) {
if ("." != $file && ".." != $file && ".htaccess" != $file && "index.php" != $file) {
$cmd = "php ./weathermap.php --config $conf_dir/$file --base-href $basehref --chdir ".$config['rrd_dir'];
if (!empty($config['rrdcached'])) {
$cmd = $cmd." --daemon ".$config['rrdcached'];
}
if ("." != $file && ".." != $file && ".htaccess" != $file && "index.php" != $file)
{
$cmd = "php ./poller.php --config $conf_dir/$file --base-href $basehref";

if (!empty($config['rrdcached']))
{
$cmd = $cmd." --daemon ".$config['rrdcached'];
}
else
{
$cmd = $cmd." --chdir ".$config['rrd_dir'];
}

$fp = popen($cmd, 'r');
while (!feof($fp)) {
$read = fgets($fp);
Expand Down

0 comments on commit b18db6d

Please sign in to comment.