got routing essentially working
[spider.git] / cmd / stat / channel.pl
diff --git a/cmd/stat/channel.pl b/cmd/stat/channel.pl
new file mode 100644 (file)
index 0000000..147c150
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# show the channel status
+#
+# $Id$
+#
+
+use strict;
+my ($self, $line) = @_;
+my @list = split /\s+/, $line;           # generate a list of callsigns
+@list = ($self->call) if !@list || $self->priv < 9;  # my channel if no callsigns
+
+my $call;
+my @out;
+foreach $call (@list) {
+  $call = uc $call;
+  my $ref = DXChannel->get($call);
+  if ($ref) {
+    @out = print_all_fields($self, $ref, "Channe Information $call");
+  } else {
+    return (0, "Channel: $call not found") if !$ref;
+  }
+  push @out, "" if @list > 1;
+}
+
+return (1, @out);
+
+