b49b2dbedc53a64ed5f75fa85ba7080fb59b022f
[spider.git] / cmd / rinit.pl
1 #
2 # reverse init a cluster connection
3 #
4 # Copyright (c) 1999 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8 my ($self, $line) = @_;
9 my @calls = split /\s+/, $line;
10 my $call;
11 my @out;
12
13 return (1, $self->msg('e5')) if $self->priv < 5;
14
15 foreach $call (@calls) {
16         $call = uc $call;
17         next if $call eq $main::mycall;
18         my $dxchan = DXChannel->get($call);
19         if ($dxchan) {
20                 if ($dxchan->is_node) {
21                         
22                         # first clear out any nodes on this dxchannel
23                         my $node = Route::Node::get($self->{call});
24                         my @rout = $node->del_nodes if $node;
25                         DXProt::route_pc21($self, @rout);
26                         $dxchan->send(DXProt::pc20());
27                         $dxchan->state('init');
28                         push @out, $self->msg('init1', $call);
29                 } 
30         } else {
31                 push @out, $self->msg('e10', $call);
32         }
33 }
34
35 return (1, @out);
36