Browse Source

Make sure that we do not overwrite status other than offline and online.

master
Bernhard Fröhlich 2 years ago
parent
commit
cb57e18e10
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      bin/updatelinkdata

+ 4
- 4
bin/updatelinkdata View File

@@ -80,11 +80,11 @@ foreach($links as $linkdata)
logMsg("Could not insert linkdata", "ERROR");
}

$handle->exec('UPDATE interfaces SET status = \'online\' WHERE interfaceid = '.$link->fromif);
$handle->exec('UPDATE interfaces SET status = \'online\' WHERE interfaceid = '.$link->toif);
$handle->exec('UPDATE interfaces SET status = \'online\' WHERE status = \'offline\' AND interfaceid = '.$link->fromif);
$handle->exec('UPDATE interfaces SET status = \'online\' WHERE status = \'offline\' AND interfaceid = '.$link->toif);

$handle->exec('UPDATE locations SET status = \'online\' WHERE locationid = '.$link->getFromLocation()->locationid);
$handle->exec('UPDATE locations SET status = \'online\' WHERE locationid = '.$link->getToLocation()->locationid);
$handle->exec('UPDATE locations SET status = \'online\' WHERE status = \'offline\' AND locationid = '.$link->getFromLocation()->locationid);
$handle->exec('UPDATE locations SET status = \'online\' WHERE status = \'offline\' AND locationid = '.$link->getToLocation()->locationid);

printf("%s -> %s (%f)\n", $linkdata['from'], $linkdata['to'], $linkdata['quality']);
}

Loading…
Cancel
Save