]> scm.dxcluster.org Git - spider.git/blob - cmd/init.pl
add UPGRADE.mojo
[spider.git] / cmd / init.pl
1 #
2 # init a cluster connection
3 #
4 # Copyright (c) 1999 Dirk Koopman G1TLH
5 #
6 #
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                         # first clear out any nodes on this dxchannel
22                         my $parent = Route::Node::get($call);
23                         my @rout = $parent->del_nodes;
24                         $dxchan->route_pc21(undef, $self, @rout) if @rout;
25                         $dxchan->send(DXProt::pc18());
26                         $dxchan->state('init');
27                         push @out, $self->msg('init1', $call);
28                 } 
29         } else {
30                 push @out, $self->msg('e10', $call);
31         }
32 }
33
34 return (1, @out);
35