add CTY-3304
[spider.git] / cmd / run.pl
1 #
2 # the run command
3 #
4 # run a script from the scripts directory
5 #
6 # Copyright (c) 1998 Dirk Koopman G1TLH
7 #
8 #
9 #
10
11 my ($self, $line) = @_;
12 my @f = split /\s+/, $line;
13 my @out;
14
15 while (@f) {
16         my $f = shift @f;
17         
18         if (is_callsign(uc $f) && $self->priv < 8 && uc $f ne $self->call) {
19                 push @out, $self->msg('e5');
20                 next;
21         }
22         $f =~ s|[^-\w/\\]||g;
23         my $script = new Script(lc $f);
24         unless ($script) {
25                 push @out, $self->msg('e3', 'script', $f);
26                 next;
27         }
28         $script->run($self);
29 }
30
31 return (1, @out);
32