X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Finit.pl;fp=cmd%2Finit.pl;h=bfcb9bd290a2bca678bc7694cd34e260f8951367;hb=85564500ce87c832f2a99fd96ccc1775dc896a0d;hp=0000000000000000000000000000000000000000;hpb=9da1742219a27b1c02fd57794412088e4d7b3d1d;p=spider.git diff --git a/cmd/init.pl b/cmd/init.pl new file mode 100644 index 00000000..bfcb9bd2 --- /dev/null +++ b/cmd/init.pl @@ -0,0 +1,35 @@ +# +# reinit a cluster connection +# +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_ak1a) { + + # first clear out any nodes on this dxchannel + my @gonenodes = map { $_->dxchan == $dxchan ? $_ : () } DXNode::get_all(); + foreach my $node (@gonenodes) { + next if $dxchan == $DXProt::me; + DXProt::broadcast_ak1a(DXProt::pc21($node->call, 'Gone, re-init') , $dxchan) unless $dxchan->{isolate}; + $node->del(); + } + $dxchan->send(DXProt::pc38()); + $dxchan->send(DXProt::pc18()); + push @out, $self->msg('init1', $call); + } + } else { + push @out, $self->msg('e10', $call); + } +} + +return (1, @out); +