fix badspotters and local ann/full.
[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 # is it me?
20 return (1, $self->msg('pinge1')) if $call eq $main::mycall;
21
22 # can we see it? Is it a node?
23 my $noderef = Route::Node::get($call);
24 $noderef = RouteDB::get($call) unless $noderef;
25
26 return (1, $self->msg('e7', $call)) unless $noderef;
27
28 # ping it
29 DXXml::Ping::add($self, $call);
30
31 return (1, $self->msg('pingo', $call));
32
33