move userconfig and nodeconfig to stat
[spider.git] / cmd / stat / nodeconfig.pl
diff --git a/cmd/stat/nodeconfig.pl b/cmd/stat/nodeconfig.pl
new file mode 100644 (file)
index 0000000..5fa45b9
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# show who all the nodes are connected to
+#
+# Copyright (c) 2001 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @list = map { uc } split /\s+/, $line;           # list of callsigns of nodes
+my @out;
+my @nodes = sort {$a->call cmp $b->call} values %Route::Node::list;
+
+foreach my $nref (@nodes) {
+       my $ncall = $nref->call;
+       next if @list && !grep $ncall =~ m|$_|, @list;
+       my $call = $nref->user_call;
+       my $l = join ',', (map {my $ref = Route::Node::get($_); $ref ? ($ref->user_call) : ("$_?")} sort @{$nref->parent});
+       push @out, "$call->$l";
+}
+
+return (1, @out);