Last change
on this file since 4949 was 4317, checked in by dirkx, 20 years ago |
Fixing line types
|
-
Property svn:eol-style
set to
native
|
File size:
932 bytes
|
Line | |
---|
1 | #!/usr/bin/perl
|
---|
2 | # use strict;
|
---|
3 | use Data::Dumper;
|
---|
4 |
|
---|
5 | $|++;
|
---|
6 |
|
---|
7 | my $DIR='../nodes';
|
---|
8 | my @nodes=();
|
---|
9 |
|
---|
10 | opendir(DIR,$DIR) or die $!;
|
---|
11 |
|
---|
12 | my $nodes = \();
|
---|
13 |
|
---|
14 | foreach(readdir(DIR)) {
|
---|
15 | next unless m/[CH]Node[\w+]/;
|
---|
16 | # print STDERR "Working on: $_\n";
|
---|
17 | my $n = $_;
|
---|
18 | my $f = $DIR.'/'.$n.'/wleiden.conf';
|
---|
19 | next unless -r $f;
|
---|
20 | eval qq|
|
---|
21 | package $n;
|
---|
22 | require "$f";
|
---|
23 | \$\::nodes->{$n} = \{
|
---|
24 | 'location' => \$location,
|
---|
25 | 'master_ip' => \$master_ip,
|
---|
26 | 'nodename' => \$nodename,
|
---|
27 | 'X' => \$X,
|
---|
28 | 'Y' => \$Y,
|
---|
29 | 'config' => \{ %config },
|
---|
30 | };
|
---|
31 | 1;
|
---|
32 | |;
|
---|
33 | die "Parse error: $@" if $@;
|
---|
34 | push @nodes, $_;
|
---|
35 | };
|
---|
36 |
|
---|
37 | foreach my $n (@nodes) {
|
---|
38 | $c = $::nodes->{$n}->{config};
|
---|
39 | foreach my $if (keys %$c ) {
|
---|
40 | foreach(split(m/\n/,$c->{$if})) {
|
---|
41 | chomp;
|
---|
42 | s/#.*//;
|
---|
43 | next if m/^\s*$/;
|
---|
44 | die unless my ($k,$v) = split /=/;
|
---|
45 | # print "$n\t$if\t$k\t$v\n";
|
---|
46 | $::nodes->{$n}->{ifaces}->{$if}->{$k}=$v;
|
---|
47 | };
|
---|
48 | };
|
---|
49 | delete $::nodes->{$n}->{config};
|
---|
50 | }
|
---|
51 |
|
---|
52 | print Dumper($::nodes);
|
---|
53 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.