loads of changes and added things
[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   next if $call eq $main::mycall;
16   my $dxchan = DXChannel->get($call);
17   if ($dxchan) {
18     if ($dxchan->is_ak1a) {
19       $dxchan->send_now("D", DXProt::pc39($main::mycall, 'Disconnected'));
20     } else {
21       $dxchan->disconnect;
22         } 
23         push @out, "disconnected $call";
24   } else {
25     push @out, "$call not connected locally";
26   }
27 }
28
29 return (1, @out);