detail changes in console
[spider.git] / cmd / connect.pl
index ed6ba9a07a8286dbfd622bc7397af452be741df1..14f94bb3e4a93c31924091dc7b4b500dac28ff6f 100644 (file)
@@ -5,7 +5,7 @@ my $self = shift;
 my $call = uc shift;
 my $lccall = lc $call;
 
-return (0) if $self->priv < 8;
+return (1, $self->msg('e5')) if $self->priv < 5;
 return (1, $self->msg('e6')) unless $call gt ' ';
 return (1, $self->msg('already', $call)) if DXChannel->get($call);
 return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall";
@@ -18,11 +18,14 @@ if (defined $pid) {
        if (!$pid) {
                # in child, unset warnings, disable debugging and general clean up from us
                $^W = 0;
+               $SIG{HUP} = 'IGNORE';
                eval "{ package DB; sub DB {} }";
                alarm(0);
+               DXChannel::closeall();
                $SIG{CHLD} = $SIG{TERM} = $SIG{INT} = $SIG{__WARN__} = 'DEFAULT';
                exec $prog, $call, 'connect';
        } else {
+               sleep(1);    # do a coordination
                return(1, $self->msg('constart', $call));
        }
 }