tidy up shutdown and issue error message if priv not high enough
[spider.git] / cmd / shutdown.pl
1 #
2 # the shutdown command
3
4 # $Id$
5 #
6 my $self = shift;
7 my $call = $self->call;
8 my $ref;
9 return (1, $self->msg('e5')) unless $self->priv >= 5;
10 foreach $ref (DXChannel::get_all()) {
11         $ref->send_now("D", DXProt::pc39($main::mycall, "Shutdown by $call")) if $ref->is_node  && $ref != $DXProt::me; 
12         $ref->send_now("D", $self->msg('shutting')) if $ref->is_user;
13 }
14     
15 # give some time for the buffers to empty and then shutdown (see cluster.pl)
16 $main::decease = 250;
17         
18
19 return (1);