add show/userconfig command
authorminima <minima>
Wed, 6 Jun 2001 14:39:10 +0000 (14:39 +0000)
committerminima <minima>
Wed, 6 Jun 2001 14:39:10 +0000 (14:39 +0000)
Changes
cmd/show/userconfig.pl [new file with mode: 0644]

diff --git a/Changes b/Changes
index b17e22fc29513344aae353b34a9e7b2395fa6c50..8b40e6f1703a900203fddacd7710090c13383ddb 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 06Jun01=======================================================================
 1. add stat/route_node and stat/route_user commands
+2. add sh/userconfig command (to show backward links to nodes)
 05Jun01=======================================================================
 1. add set/bbs command
 2. more work on Routing code.
diff --git a/cmd/show/userconfig.pl b/cmd/show/userconfig.pl
new file mode 100644 (file)
index 0000000..f432116
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# show who all the users 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 @users = sort {$a->call cmp $b->call} values %Route::User::list;
+
+foreach my $uref (@users) {
+       my $ucall = $uref->call;
+       next if @list && !grep $ucall =~ m|$_|, @list;
+       my $call = $uref->user_call;
+       my $l = join ',', (map {my $ref = Route::Node::get($_); $ref ? ($ref->user_call) : ("$_?")} sort @{$uref->parent});
+       push @out, "$call->$l";
+}
+
+return (1, @out);