X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Frinit.pl;fp=cmd%2Frinit.pl;h=93748ca1e453e8a3645e776086080a5af1e73f2a;hb=95345d68a5a8ac618021c0786c7234258b903f6e;hp=0000000000000000000000000000000000000000;hpb=503b6b1f503860def06f4e2121b0367e856081cd;p=spider.git diff --git a/cmd/rinit.pl b/cmd/rinit.pl new file mode 100644 index 00000000..93748ca1 --- /dev/null +++ b/cmd/rinit.pl @@ -0,0 +1,41 @@ +# +# reverse init a cluster connection +# +# Copyright (c) 1999 Dirk Koopman G1TLH +# +# $Id$ +# +my ($self, $line) = @_; +my @calls = split /\s+/, $line; +my $call; +my @out; + +return (1, $self->msg('e5')) if $self->priv < 5; + +foreach $call (@calls) { + $call = uc $call; + next if $call eq $main::mycall; + my $dxchan = DXChannel->get($call); + if ($dxchan) { + if ($dxchan->is_node) { + + # first clear out any nodes on this dxchannel + my @gonenodes = grep { $_->dxchan == $dxchan } DXNode::get_all(); + foreach my $node (@gonenodes) { + next if $node->dxchan == $DXProt::me; + next unless $node->dxchan == $dxchan; + DXProt::broadcast_ak1a(DXProt::pc21($node->call, 'Gone, re-init') , $dxchan) unless $dxchan->{isolate}; + $node->del(); + } +# $dxchan->send(DXProt::pc38()); + $dxchan->send(DXProt::pc20()); + $dxchan->state('init'); + push @out, $self->msg('init1', $call); + } + } else { + push @out, $self->msg('e10', $call); + } +} + +return (1, @out); +