X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Finit.pl;h=b88ed013352bcb4d0c396917332ad09a5a507b58;hb=63b5e2134b2ffba051682618f88b09d5ee5457c7;hp=bfcb9bd290a2bca678bc7694cd34e260f8951367;hpb=85564500ce87c832f2a99fd96ccc1775dc896a0d;p=spider.git diff --git a/cmd/init.pl b/cmd/init.pl index bfcb9bd2..b88ed013 100644 --- a/cmd/init.pl +++ b/cmd/init.pl @@ -1,5 +1,9 @@ # -# reinit a cluster connection +# init a cluster connection +# +# Copyright (c) 1999 Dirk Koopman G1TLH +# +# $Id$ # my ($self, $line) = @_; my @calls = split /\s+/, $line; @@ -13,17 +17,19 @@ foreach $call (@calls) { next if $call eq $main::mycall; my $dxchan = DXChannel->get($call); if ($dxchan) { - if ($dxchan->is_ak1a) { + if ($dxchan->is_node) { # first clear out any nodes on this dxchannel - my @gonenodes = map { $_->dxchan == $dxchan ? $_ : () } DXNode::get_all(); + my @gonenodes = grep { $_->dxchan == $dxchan } DXNode::get_all(); foreach my $node (@gonenodes) { - next if $dxchan == $DXProt::me; + 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::pc38()); $dxchan->send(DXProt::pc18()); + $dxchan->state('init'); push @out, $self->msg('init1', $call); } } else {