X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshutdown.pl;h=4ee21ebade351aae062ff0b6029a6727d1f2a589;hb=9e6f8da122e48430e5b56b27cf7d06c688cb2e13;hp=43b6fb7531a24887dea609cb7f39a7fc095e9dfa;hpb=6b6a8002929017b6d4217f68fa492a2d728ee1fe;p=spider.git diff --git a/cmd/shutdown.pl b/cmd/shutdown.pl index 43b6fb75..4ee21eba 100644 --- a/cmd/shutdown.pl +++ b/cmd/shutdown.pl @@ -4,7 +4,16 @@ # $Id$ # my $self = shift; -if ($self->priv >= 5) { - &main::cease(); +my $call = $self->call; +my $ref; +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 (0); + +# give some time for the buffers to empty and then shutdown (see cluster.pl) +$main::decease = 250; + + +return (1);