X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshutdown.pl;fp=cmd%2Fshutdown.pl;h=1b3d8bb2432ad4f423e11c8909e57433d4059bcd;hb=e06d5fa736172c044f769e791c23e7cd05ae3445;hp=695748aa0df793aa32bd212493b737109f6f4140;hpb=0b0607e3fba746fc50920f2188ead0c4d0750b2c;p=spider.git diff --git a/cmd/shutdown.pl b/cmd/shutdown.pl index 695748aa..1b3d8bb2 100644 --- a/cmd/shutdown.pl +++ b/cmd/shutdown.pl @@ -6,15 +6,14 @@ 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_node && $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_now("D", DXProt::pc39($main::mycall, "Shutdown by $call")) if $ref->is_node && $ref != $DXProt::me; + $ref->send_now("D", $self->msg('shutting')) if $ref->is_user; } -return (1); + +# give some time for the buffers to empty and then shutdown (see cluster.pl) +$main::decease = 250; + + +return (1, $self->msg('shutting'));