Fix AS-SET lookup on systems where the whois command returns additional lines.

This commit is contained in:
Manuel Kasper 2012-09-06 12:49:19 +00:00
parent f149dce73f
commit 436fe23352
2 changed files with 12 additions and 1 deletions

3
README
View File

@ -7,6 +7,9 @@ Changes
-------
vx.xx Add links to PeeringDB and robtex
(suggested by Steve Glendinning)
Fix AS-SET lookup on systems where the whois command returns
additional lines.
v1.36 Fix creation of new RRDs when multiple entries with the same

View File

@ -164,7 +164,15 @@ function getASSET($asset) {
$cmd = $whois ." -h whois.radb.net '!i".$asset."'";
$return_aslist = explode("\n",shell_exec($cmd));
$aslist = explode(" ",$return_aslist[1]);
/* find the line that contains the AS-SET members */
$aslist = array();
foreach ($return_aslist as $asline) {
if (preg_match("/^AS/", $asline)) {
$aslist = explode(" ", $asline);
break;
}
}
$f = fopen($assetfile,"w");
foreach ($aslist as $as) {