c974799ea9d1034ef41863de6f2cde27cda42ced
[spider.git] / cmd / bye.pl
1 #
2 # the bye command
3 #
4 #
5 #
6
7
8 my $self = shift;
9 return (1, $self->msg('e5')) if $self->inscript || $self->remotecmd;
10
11 my $fn = localdata("logout");
12 dbg("fn: $fn " . (-e $fn ? 'exists' : 'missing'));
13
14 if ($self->is_user && -e $fn) {
15         $self->send_file($fn);
16         Mojo::IOLoop->timer($Msg::disc_waittime, sub{$self->disconnect});
17 } else {
18         $self->disconnect;
19 }
20
21 return (1);