mirror of https://github.com/aredn/aredn.git
bugfix: snrlog better handle neighbor references from mac to ip to hostname
This commit is contained in:
parent
cc6d4ee550
commit
38209b0af2
|
@ -1,4 +1,4 @@
|
|||
*/5 * * * * /usr/local/bin/fccid
|
||||
*/1 * * * * /usr/local/bin/rssi_monitor
|
||||
* * * * * /usr/local/bin/rssi_monitor
|
||||
* * * * * /usr/local/bin/snrlog
|
||||
|
||||
|
|
|
@ -62,19 +62,29 @@ if (! -e $tmpdir ) { system("mkdir $tmpdir > /dev/null"); }
|
|||
$d = sprintf ("%02d/%02d %02d:%02d:%02d",$mon+1, $mday,$hour, $min, $sec);
|
||||
chomp ($now=`cat /proc/uptime | cut -f1 -d" "`);
|
||||
|
||||
foreach $sigmac ( `ls $sigdir` )
|
||||
foreach $sigmac ( glob "$sigdir/*" )
|
||||
{
|
||||
$sigmac =~ s/^.*\///;
|
||||
chomp $sigmac;
|
||||
$isFile = "";
|
||||
$hnamef = "";
|
||||
$ipsig = "";
|
||||
$macfname = "";
|
||||
$macfname = `ls $tmpdir/$sigmac*` ;
|
||||
$macfname =~ /^.*\/([^-]*)-(.*)$/;
|
||||
$isFile = $1;
|
||||
$hnamef = $2;
|
||||
|
||||
chomp ($ipsig = `cat /proc/net/arp | grep $sigmac | cut -f1 -d\" "`);
|
||||
@maclist = glob "$tmpdir/$sigmac*";
|
||||
if (@maclist) { $macfname = $maclist[-1]; }
|
||||
else { $macfname = ""; }
|
||||
|
||||
if ($macfname)
|
||||
{
|
||||
$macfname =~ /^.*\/([^-]*)-(.*)$/ ;
|
||||
$isFile=$1;
|
||||
$hnamef=$2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$macfname = "";
|
||||
$isFile = "";
|
||||
$hnamef = "";
|
||||
}
|
||||
$ipsig = "";
|
||||
chomp ($ipsig = `cat /proc/net/arp | grep $sigmac | grep 'wlan0' | cut -f1 -d\" "`);
|
||||
$hname="";
|
||||
foreach(`nslookup $ipsig`)
|
||||
{
|
||||
|
@ -83,7 +93,7 @@ foreach $sigmac ( `ls $sigdir` )
|
|||
break;
|
||||
}
|
||||
|
||||
if (($hnamef and $hnamef eq $hname ) or ($hname and ! $isFile ))
|
||||
if (($hnamef and $hnamef eq $hname ) or ($hname and $isFile eq "" ))
|
||||
{
|
||||
$sigdat = "$sigmac-$hname";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue