Skip to content
Permalink
Browse files

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

  • Loading branch information...
decke committed Sep 30, 2017
1 parent b2648b3 commit cb57e18e103cb61c33a138e4bd5424f4de40a86e
Showing with 4 additions and 4 deletions.
  1. +4 −4 bin/updatelinkdata
@@ -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']);
}

0 comments on commit cb57e18

Please sign in to comment.
You can’t perform that action at this time.