added ping and rcmd commands
[spider.git] / cmd / rcmd.pl
1 #
2 # rcmd command
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my $self = shift;
10 my $line = shift; 
11 my ($call) = $line =~ /^\s*(\S+)/;
12
13 # are we permitted?
14 return (1, $self->msg('e5')) if $self->priv < 6;
15
16 # is there a call?
17 return (1, $self->msg('e6')) if !$call;
18
19 # remove the callsign from the line
20 $line =~ s/^\s*$call\s+//;
21
22 # can we see it? Is it a node?
23 $call = uc $call;
24 my $noderef = DXCluster->get_exact($call);
25 return (1, $self->msg('e7', $call)) if !$noderef || !$noderef->pcversion;
26
27 # ping it
28 DXProt::addrcmd($self->call, $call, $line);
29
30 return (1, $self->msg('rcmdo', $line, $call));