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