diff --git a/files/www/cgi-bin/mesh b/files/www/cgi-bin/mesh index 78b24894..470db199 100755 --- a/files/www/cgi-bin/mesh +++ b/files/www/cgi-bin/mesh @@ -128,16 +128,23 @@ foreach(`cat /var/run/services_olsr 2>/dev/null`) chomp; ($url, $junk, $name) = split /\|/, $_; next unless defined $name; - ($host, $port) = $url =~ /^\w+:\/\/([\w\-\.]+):(\d+)/; + ($protocol, $host, $port, $path) = $url =~ /^(\w+):\/\/([\w\-\.]+):(\d+)\/(.*)/; + next unless defined $path; ($name, $originator) = split /\#/, $name; $name =~ s/\s+$//; + + if ( $host !~ /\./ ) + { + $host="${host}.local.mesh"; + } + #$host = $originator eq " my own service" ? $node : $hosts{$originator}{name}; # attempt to work around olsr never forgetting defunct services # assume that the first entry in the file by this name is the most recent, ignore the rest next if $services{$host}{$name}; - $services{$host}{$name} = $port ? "$name" : $name; + $services{$host}{$name} = $port ? "$name" : $name; } # load the node history @@ -221,7 +228,7 @@ if(keys %localhosts) foreach $ip (keys %localhosts) { - $host = $localhosts{$ip}{name}; + $host = $localhosts{$ip}{name} . ".local.mesh"; $tactical = $localhosts{$ip}{tactical} ? " / " . $localhosts{$ip}{tactical} : ""; $rows{$host} = sprintf "