X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshutdown.pl;h=cfed8d400ad5e2741f765c7aaa0dd71e2b771950;hb=d17f05b19fac36a0a8a2f828912a1a7ebefae79f;hp=c2350de0f197df34f70f58fe51d4173f5be72650;hpb=b060a0a3ee72530aa3f10d453186a662b66d7efe;p=spider.git diff --git a/cmd/shutdown.pl b/cmd/shutdown.pl index c2350de0..cfed8d40 100644 --- a/cmd/shutdown.pl +++ b/cmd/shutdown.pl @@ -1,20 +1,17 @@ # # the shutdown command # -# $Id$ +# # my $self = shift; my $call = $self->call; my $ref; - -if ($self->priv >= 5) { - foreach $ref (DXChannel::get_all()) { - $ref->send_now("D", DXProt::pc39($main::mycall, "Shutdown by $call")) - if $ref->is_ak1a && $ref != $DXProt::me; - $ref->send_now("D", $self->msg('shutting')) if $ref->is_user; - } - - # give some time for the buffers to empty and then shutdown (see cluster.pl) - $main::decease = 250; +return (1, $self->msg('e5')) unless $self->priv >= 5; +foreach $ref (DXChannel::get_all()) { + $ref->send($self->msg('shutting')) if $ref->is_user; } + +# give some time for the buffers to empty and then shutdown (see cluster.pl) +$main::decease->send; + return (1);