aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-collector.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'sitesummary-collector.cgi')
-rw-r--r--sitesummary-collector.cgi36
1 files changed, 18 insertions, 18 deletions
diff --git a/sitesummary-collector.cgi b/sitesummary-collector.cgi
index c79190d..70bca7c 100644
--- a/sitesummary-collector.cgi
+++ b/sitesummary-collector.cgi
@@ -95,10 +95,10 @@ sub extract_unique_id {
my $eth2mac;
open(IFCONFIG, "system/ifconfig-a") || die "Unable to read ifconfig-a";
while (<IFCONFIG>) {
- chomp;
- $eth0mac = $1 if (m/^eth0\s+Link encap:Ethernet HWaddr (\S+)/);
- $eth1mac = $1 if (m/^eth1\s+Link encap:Ethernet HWaddr (\S+)/);
- $eth2mac = $1 if (m/^eth2\s+Link encap:Ethernet HWaddr (\S+)/);
+ chomp;
+ $eth0mac = $1 if (m/^eth0\s+Link encap:Ethernet HWaddr (\S+)/);
+ $eth1mac = $1 if (m/^eth1\s+Link encap:Ethernet HWaddr (\S+)/);
+ $eth2mac = $1 if (m/^eth2\s+Link encap:Ethernet HWaddr (\S+)/);
}
close (IFCONFIG);
#print STDERR "MAC: $eth0mac\n";
@@ -110,12 +110,12 @@ sub process_entry {
my ($peeripaddr, $peername, $filename) = @_;
my $dirname;
if ($filename =~ m/(.+).tar.gz$/) {
- $dirname = $1;
- mkdir $dirname;
- chdir $dirname;
- `tar zxf $filename`;
+ $dirname = $1;
+ mkdir $dirname;
+ chdir $dirname;
+ `tar zxf $filename`;
} else {
- die "Unhandled file format '$filename'";
+ die "Unhandled file format '$filename'";
}
open(PEERINFO, ">peerinfo") || die;
@@ -127,20 +127,20 @@ sub process_entry {
my $status = "new";
if ( -d $newdir ) {
- `rm -r $newdir`;
- my $status = "update";
+ `rm -r $newdir`;
+ my $status = "update";
}
rename $dirname, $newdir || die;
for my $handler (<$handlerdir/*>) {
- `$handler $newdir $status`;
+ `$handler $newdir $status`;
}
}
sub get_peerinfo {
my $sockethandle = shift;
- # Return something while this function do not work.
+ # XXX Return something while this function do not work.
return ("127.0.0.1", "localhost");
# XXX The call to sockaddr_in trigger "Bad arg length for
@@ -148,12 +148,12 @@ sub get_peerinfo {
# /usr/lib/perl/5.8/Socket.pm line 198." No idea why.
my ($peerport, $peeripaddr) = sockaddr_in(getpeername($sockethandle));
if ($peerport) {
- my $peername = gethostbyaddr($peeripaddr, AF_INET);
+ my $peername = gethostbyaddr($peeripaddr, AF_INET);
- if ("" eq $peername) {
- syslog('warning', "client without DNS entry connected from \[$peeripaddr\]");
- $peername = "$peeripaddr";
- }
+ if ("" eq $peername) {
+ syslog('warning', "client without DNS entry connected from \[$peeripaddr\]");
+ $peername = "$peeripaddr";
+ }
} else {
# Running on the command line, use test host
$peeripaddr = "127.0.0.1";