6154d3cc27c0e7bc26fa61d68db6d5998ef726e3
[spider.git] / cmd / disconnect.pl
1 #
2 # disconnect a local user
3 #
4 my ($self, $line) = @_;
5 my @calls = split /\s+/, $line;
6 my $call;
7 my @out;
8
9 if ($self->priv < 9) {
10   return (1, "not allowed");
11 }
12
13 foreach $call (@calls) {
14   $call = uc $call;
15   my $dxchan = DXChannel->get($call);
16   if ($dxchan) {
17     if ($dxchan->is_ak1a) {
18       $dxchan->send_now("D", $self->pc39('Disconnected'));
19         } else {
20       $dxchan->disconnect;
21         }
22         push @out, "disconnected $call";
23   } else {
24     push @out, "$call not connected locally";
25   }
26 }
27
28 return (1, @out);