3 # This module impliments the user facing command mode for a dx cluster
5 # Copyright (c) 1998 Dirk Koopman G1TLH
10 package DXCommandmode;
40 use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug $maxbadcount $msgpolltime);
42 %Cache = (); # cache of dynamically loaded routine's mod times
43 %cmd_cache = (); # cache of short names
44 $errstr = (); # error string from eval
45 %aliases = (); # aliases for (parts of) commands
46 $scriptbase = "$main::root/scripts"; # the place where all users start scripts go
47 $maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection
48 $maxbadcount = 3; # no of bad words allowed before disconnection
49 $msgpolltime = 3600; # the time between polls for new messages
52 use vars qw($VERSION $BRANCH);
53 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
54 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
55 $main::build += $VERSION;
56 $main::branch += $BRANCH;
59 # obtain a new connection this is derived from dxchannel
64 my $self = DXChannel::alloc(@_);
66 # routing, this must go out here to prevent race condx
69 my @rout = $main::routeroot->add_user($call, Route::here(1));
71 # ALWAYS output the user
72 my $ref = Route::User::get($call);
73 $main::me->route_pc16($main::mycall, undef, $main::routeroot, $ref) if $ref;
78 # this is how a a connection starts, you get a hello message and the motd with
79 # possibly some other messages asking you to set various things up if you are
80 # new (or nearly new and slacking) user.
84 my ($self, $line, $sort) = @_;
85 my $user = $self->{user};
86 my $call = $self->{call};
87 my $name = $user->{name};
90 my $host = $self->{conn}->{peerhost} || "unknown";
91 Log('DXCommand', "$call connected from $host");
93 $self->{name} = $name ? $name : $call;
94 $self->send($self->msg('l2',$self->{name}));
95 $self->state('prompt'); # a bit of room for further expansion, passwords etc
96 $self->{priv} = $user->priv || 0;
97 $self->{lang} = $user->lang || $main::lang || 'en';
98 $self->{pagelth} = $user->pagelth || 20;
99 ($self->{width}) = $line =~ /width=(\d+)/; $line =~ s/\s*width=\d+\s*//;
100 $self->{width} = 80 unless $self->{width} && $self->{width} > 80;
101 $self->{consort} = $line; # save the connection type
103 # set some necessary flags on the user if they are connecting
104 $self->{beep} = $user->wantbeep;
105 $self->{ann} = $user->wantann;
106 $self->{wwv} = $user->wantwwv;
107 $self->{wcy} = $user->wantwcy;
108 $self->{talk} = $user->wanttalk;
109 $self->{wx} = $user->wantwx;
110 $self->{dx} = $user->wantdx;
111 $self->{logininfo} = $user->wantlogininfo;
112 $self->{ann_talk} = $user->wantann_talk;
114 $self->{prompt} = $user->prompt if $user->prompt;
116 # sort out new dx spot stuff
117 $user->wantdxcq(0) unless defined $user->{wantdxcq};
118 $user->wantdxitu(0) unless defined $user->{wantdxitu};
119 $user->wantusstate(0) unless defined $user->{wantusstate};
121 # sort out registration
122 if ($main::reqreg == 1) {
123 $self->{registered} = $user->registered;
124 } elsif ($main::reqreg == 2) {
125 $self->{registered} = !$user->registered;
127 $self->{registered} = 1;
131 # decide which motd to send
132 my $motd = "${main::motd}_nor" unless $self->{registered};
133 $motd = $main::motd unless $motd && -e $motd;
134 $self->send_file($motd) if -e $motd;
136 # sort out privilege reduction
137 $self->{priv} = 0 if $line =~ /^(ax|te)/ && !$self->conn->{usedpasswd};
140 $self->{spotsfilter} = Filter::read_in('spots', $call, 0) || Filter::read_in('spots', 'user_default', 0);
141 $self->{wwvfilter} = Filter::read_in('wwv', $call, 0) || Filter::read_in('wwv', 'user_default', 0);
142 $self->{wcyfilter} = Filter::read_in('wcy', $call, 0) || Filter::read_in('wcy', 'user_default', 0);
143 $self->{annfilter} = Filter::read_in('ann', $call, 0) || Filter::read_in('ann', 'user_default', 0) ;
145 # clean up qra locators
146 my $qra = $user->qra;
147 $qra = undef if ($qra && !DXBearing::is_qra($qra));
149 my $lat = $user->lat;
150 my $long = $user->long;
151 $user->qra(DXBearing::lltoqra($lat, $long)) if (defined $lat && defined $long);
155 my $echo = $user->wantecho;
157 $self->send_now('E', "0");
158 $self->send($self->msg('echow'));
159 $self->conn->echo($echo) if $self->conn->can('echo');
162 $self->tell_login('loginu');
164 # do we need to send a forward/opernam?
165 my $lastoper = $user->lastoper || 0;
166 my $homenode = $user->homenode || "";
167 if ($homenode eq $main::mycall && $main::systime >= $lastoper + $DXUser::lastoperinterval) {
168 run_cmd($main::me, "forward/opernam $call");
169 $user->lastoper($main::systime + ((int rand(10)) * 86400));
172 # run a script send the output to the punter
173 my $script = new Script(lc $call) || new Script('user_default');
174 $script->run($self) if $script;
177 my $info = Route::cluster();
178 $self->send("Cluster:$info");
180 # send prompts and things
181 $self->send($self->msg('namee1')) if !$user->name;
182 $self->send($self->msg('qthe1')) if !$user->qth;
183 $self->send($self->msg('qll')) if !$user->qra || (!$user->lat && !$user->long);
184 $self->send($self->msg('hnodee1')) if !$user->qth;
185 $self->send($self->msg('m9')) if DXMsg::for_me($call);
186 $self->lastmsgpoll($main::systime);
191 # This is the normal command prompt driver
200 # save this for them's that need it
201 my $rawline = $cmdline;
203 # remove leading and trailing spaces
204 $cmdline =~ s/^\s*(.*)\s*$/$1/;
206 if ($self->{state} eq 'page') {
207 my $i = $self->{pagelth};
208 my $ref = $self->{pagedata};
211 # abort if we get a line starting in with a
212 if ($cmdline =~ /^a/io) {
217 # send a tranche of data
218 while ($i-- > 0 && @$ref) {
219 my $line = shift @$ref;
220 $line =~ s/\s+$//o; # why am having to do this?
224 # reset state if none or else chuck out an intermediate prompt
226 $tot -= $self->{pagelth};
227 $self->send($self->msg('page', $tot));
229 $self->state('prompt');
231 } elsif ($self->{state} eq 'sysop') {
232 my $passwd = $self->{user}->passwd;
234 my @pw = grep {$_ !~ /\s/} split //, $passwd;
235 my @l = @{$self->{passwd}};
236 my $str = "$pw[$l[0]].*$pw[$l[1]].*$pw[$l[2]].*$pw[$l[3]].*$pw[$l[4]]";
237 if ($cmdline =~ /$str/) {
238 $self->{priv} = $self->{user}->priv;
240 $self->send($self->msg('sorry'));
243 $self->send($self->msg('sorry'));
245 $self->state('prompt');
246 } elsif ($self->{state} eq 'passwd') {
247 my $passwd = $self->{user}->passwd;
248 if ($passwd && $cmdline eq $passwd) {
249 $self->send($self->msg('pw1'));
250 $self->state('passwd1');
252 $self->conn->{echo} = $self->conn->{decho};
253 delete $self->conn->{decho};
254 $self->send($self->msg('sorry'));
255 $self->state('prompt');
257 } elsif ($self->{state} eq 'passwd1') {
258 $self->{passwd} = $cmdline;
259 $self->send($self->msg('pw2'));
260 $self->state('passwd2');
261 } elsif ($self->{state} eq 'passwd2') {
262 if ($cmdline eq $self->{passwd}) {
263 $self->{user}->passwd($cmdline);
264 $self->send($self->msg('pw3'));
266 $self->send($self->msg('pw4'));
268 $self->conn->{echo} = $self->conn->{decho};
269 delete $self->conn->{decho};
270 $self->state('prompt');
271 } elsif ($self->{state} eq 'talk') {
272 if ($cmdline =~ m{^(?:/EX|/ABORT)}i) {
273 for (@{$self->{talklist}}) {
274 $self->send_talks($_, $self->msg('talkend'));
276 $self->state('prompt');
277 delete $self->{talklist};
278 } elsif ($cmdline =~ m|^/+\w+|) {
280 my $sendit = $cmdline =~ s|^/+||;
281 my @in = $self->run_cmd($cmdline);
282 $self->send_ans(@in);
283 if ($sendit && $self->{talklist} && @{$self->{talklist}}) {
284 foreach my $l (@in) {
286 if (@bad = BadWords::check($l)) {
287 $self->badcount(($self->badcount||0) + @bad);
288 Log('DXCommand', "$self->{call} swore: $l");
290 for (@{$self->{talklist}}) {
291 $self->send_talks($_, $l);
296 $self->send($self->talk_prompt);
297 } elsif ($self->{talklist} && @{$self->{talklist}}) {
298 # send what has been said to whoever is in this person's talk list
300 if (@bad = BadWords::check($cmdline)) {
301 $self->badcount(($self->badcount||0) + @bad);
302 Log('DXCommand', "$self->{call} swore: $cmdline");
304 for (@{$self->{talklist}}) {
305 $self->send_talks($_, $rawline);
308 $self->send($self->talk_prompt) if $self->{state} eq 'talk';
311 $self->state('prompt');
313 } elsif (my $func = $self->{func}) {
316 if (ref $self->{edit}) {
317 eval { @ans = $self->{edit}->$func($self, $rawline)};
319 eval { @ans = &{$self->{func}}($self, $rawline) };
322 $self->send_ans("Syserr: on stored func $self->{func}", $@);
323 delete $self->{func};
324 $self->state('prompt');
327 $self->send_ans(@ans);
329 $self->send_ans(run_cmd($self, $cmdline));
332 # check for excessive swearing
333 if ($self->{badcount} && $self->{badcount} >= $maxbadcount) {
334 Log('DXCommand', "$self->{call} logged out for excessive swearing");
339 # send a prompt only if we are in a prompt state
340 $self->prompt() if $self->{state} =~ /^prompt/o;
343 # send out the talk messages taking into account vias and connectivity
346 my ($self, $ent, $line) = @_;
348 my ($to, $via) = $ent =~ /(\S+)>(\S+)/;
349 $to = $ent unless $to;
350 my $call = $via ? $via : $to;
351 my $clref = Route::get($call);
352 my $dxchan = $clref->dxchan if $clref;
354 $dxchan->talk($self->{call}, $to, $via, $line);
356 $self->send($self->msg('disc2', $via ? $via : $to));
357 my @l = grep { $_ ne $ent } @{$self->{talklist}};
359 $self->{talklist} = \@l;
361 delete $self->{talklist};
362 $self->state('prompt');
371 for (@{$self->{talklist}}) {
372 my ($to, $via) = /(\S+)>(\S+)/;
376 return $self->msg('talkprompt', join(',', @call));
380 # send a load of stuff to a command user with page prompting
388 if ($self->{pagelth} && @_ > $self->{pagelth}) {
390 for ($i = $self->{pagelth}; $i-- > 0; ) {
392 $line =~ s/\s+$//o; # why am having to do this?
395 $self->{pagedata} = [ @_ ];
396 $self->state('page');
397 $self->send($self->msg('page', scalar @_));
409 # this is the thing that runs the command, it is done like this for the
410 # benefit of remote command execution
416 my $user = $self->{user};
417 my $call = $self->{call};
422 return () if length $cmdline == 0;
424 # split the command line up into parts, the first part is the command
425 my ($cmd, $args) = split /\s+/, $cmdline, 2;
426 $args = "" unless defined $args;
429 # strip out // on command only
434 dbg("cmd: $cmd") if isdbg('command');
436 # alias it if possible
437 my $acmd = CmdAlias::get_cmd($cmd);
439 ($cmd, $args) = split /\s+/, "$acmd $args", 2;
440 $args = "" unless defined $args;
441 dbg("aliased cmd: $cmd $args") if isdbg('command');
444 # first expand out the entry to a command
445 ($path, $fcmd) = search($main::localcmd, $cmd, "pl");
446 ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
449 dbg("path: $cmd cmd: $fcmd") if isdbg('command');
451 my $package = find_cmd_name($path, $fcmd);
456 dbg("package: $package") if isdbg('command');
457 eval { @ans = &$package($self, $args) };
458 return (DXDebug::shortmess($@)) if $@;
461 dbg("cmd: $cmd not found") if isdbg('command');
462 if (++$self->{errors} > $maxerrors) {
463 $self->send($self->msg('e26'));
467 return ($self->msg('e1'));
474 delete $self->{errors};
476 if (++$self->{errors} > $maxerrors) {
477 $self->send($self->msg('e26'));
482 return map {s/([^\s])\s+$/$1/; $_} @ans;
486 # This is called from inside the main cluster processing loop and is used
487 # for despatching commands that are doing some long processing job
492 my @dxchan = DXChannel->get_all();
495 foreach $dxchan (@dxchan) {
496 next if $dxchan->sort ne 'U';
498 # send a outstanding message prompt if required
499 if ($t >= $dxchan->lastmsgpoll + $msgpolltime) {
500 $dxchan->send($dxchan->msg('m9')) if DXMsg::for_me($dxchan->call);
501 $dxchan->lastmsgpoll($t);
504 # send a prompt if no activity out on this channel
505 if ($t >= $dxchan->t + $main::user_interval) {
506 $dxchan->prompt() if $dxchan->{state} =~ /^prompt/o;
511 while (my ($k, $v) = each %nothereslug) {
512 if ($main::systime >= $v + 300) {
513 delete $nothereslug{$k};
519 # finish up a user context
524 my $call = $self->call;
526 return if $self->{disconnecting}++;
528 delete $self->{senddbg};
530 my $uref = Route::User::get($call);
533 @rout = $main::routeroot->del_user($uref);
534 dbg("B/C PC17 on $main::mycall for: $call") if isdbg('route');
536 # issue a pc17 to everybody interested
537 $main::me->route_pc17($main::mycall, undef, $main::routeroot, $uref);
539 confess "trying to disconnect a non existant user $call";
542 # I was the last node visited
543 $self->user->node($main::mycall);
545 # send info to all logged in thingies
546 $self->tell_login('logoutu');
548 Log('DXCommand', "$call disconnected");
550 $self->SUPER::disconnect;
554 # short cut to output a prompt
560 my $call = $self->call;
561 my $date = cldate($main::systime);
562 my $time = ztime($main::systime);
563 my $prompt = $self->{prompt} || $self->msg('pr');
565 $call = "($call)" unless $self->here;
566 $prompt =~ s/\%C/$call/g;
567 $prompt =~ s/\%D/$date/g;
568 $prompt =~ s/\%T/$time/g;
569 $prompt =~ s/\%M/$main::mycall/g;
571 $self->send($prompt);
574 # broadcast a message to all users [except those mentioned after buffer]
577 my $pkg = shift; # ignored
578 my $s = shift; # the line to be rebroadcast
580 foreach my $dxchan (DXChannel->get_all()) {
581 next unless $dxchan->{sort} eq 'U'; # only interested in user channels
582 next if grep $dxchan == $_, @_;
583 $dxchan->send($s); # send it
587 # gimme all the users
590 return grep {$_->{sort} eq 'U'} DXChannel->get_all();
593 # run a script for this user
597 my $silent = shift || 0;
602 # search for the command in the cache of short->long form commands
607 my ($path, $short_cmd, $suffix) = @_;
610 # commands are lower case
611 $short_cmd = lc $short_cmd;
612 dbg("command: $path $short_cmd\n") if isdbg('command');
614 # do some checking for funny characters
615 return () if $short_cmd =~ /\/$/;
617 # return immediately if we have it
618 ($apath, $acmd) = split ',', $cmd_cache{$short_cmd} if $cmd_cache{$short_cmd};
619 if ($apath && $acmd) {
620 dbg("cached $short_cmd = ($apath, $acmd)\n") if isdbg('command');
621 return ($apath, $acmd);
625 my @parts = split '/', $short_cmd;
632 for ($i = 0; $i < @parts; $i++) {
634 opendir(D, $curdir) or confess "can't open $curdir $!";
638 foreach $l (sort @ls) {
640 if ($i < $#parts) { # we are dealing with directories
641 if ((-d "$curdir/$l") && $p eq substr($l, 0, length $p)) {
642 dbg("got dir: $curdir/$l\n") if isdbg('command');
647 } else { # we are dealing with commands
648 @lparts = split /\./, $l;
649 next if $lparts[$#lparts] ne $suffix; # only look for .$suffix files
650 if ($p eq substr($l, 0, length $p)) {
651 pop @lparts; # remove the suffix
652 $l = join '.', @lparts;
653 # chop $dirfn; # remove trailing /
654 $dirfn = "" unless $dirfn;
655 $cmd_cache{$short_cmd} = join(',', ($path, "$dirfn$l")); # cache it
656 dbg("got path: $path cmd: $dirfn$l\n") if isdbg('command');
657 return ($path, "$dirfn$l");
665 # clear the command name cache
671 undef *{$_} unless /cmd_cache/;
672 dbg("Undefining cmd $_") if isdbg('command');
679 # the persistant execution of things from the command directories
682 # This allows perl programs to call functions dynamically
684 # This has been nicked directly from the perlembed pages
687 #require Devel::Symdump;
689 sub valid_package_name {
691 $string =~ s|([^A-Za-z0-9_/])|sprintf("_%2x",unpack("C",$1))|eg;
694 return "cmd_$string";
698 # this bit of magic finds a command in the offered directory
702 my $package = valid_package_name($cmdname);
703 my $filename = "$path/$cmdname.pl";
704 my $mtime = -M $filename;
706 # return if we can't find it
708 unless (defined $mtime) {
709 $errstr = DXM::msg('e1');
713 if(defined $Cache{$package}->{mtime} &&$Cache{$package}->{mtime} <= $mtime) {
714 #we have compiled this subroutine already,
715 #it has not been updated on disk, nothing left to do
716 #print STDERR "already compiled $package->handler\n";
720 my $sub = readfilestr($filename);
722 $errstr = "Syserr: can't open '$filename' $!";
726 #wrap the code into a subroutine inside our unique package
727 my $eval = qq( sub $package { $sub } );
730 my @list = split /\n/, $eval;
733 dbg($_ . "\n") if isdbg('eval');
737 # get rid of any existing sub and try to compile the new one
740 if (exists $Cache{$package}) {
741 dbg("Redefining $package") if isdbg('command');
744 dbg("Defining $package") if isdbg('command');
748 $Cache{$package} = {mtime => $mtime };
757 my ($self, $let, $buf) = @_;
758 if ($self->{state} eq 'prompt' || $self->{state} eq 'talk') {
759 if ($self->{enhanced}) {
760 $self->send_later($let, $buf);
769 # send a talk message here
772 my ($self, $from, $to, $via, $line) = @_;
773 $line =~ s/\\5E/\^/g;
774 $self->local_send('T', "$to de $from: $line") if $self->{talk};
775 Log('talk', $to, $from, $via?$via:$main::mycall, $line);
776 # send a 'not here' message if required
777 unless ($self->{here} && $from ne $to) {
778 my $key = "$to$from";
779 unless (exists $nothereslug{$key}) {
781 if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) {
782 my $name = $self->user->name || $to;
783 my $s = $self->user->nothere || $dxchan->msg('nothere', $name);
784 $nothereslug{$key} = $main::systime;
785 $dxchan->talk($to, $from, undef, $s);
802 if (!$self->{ann_talk} && $to ne $self->{call}) {
803 my $call = AnnTalk::is_talk_candidate($_[0], $text);
807 if ($self->{annfilter}) {
808 ($filter, $hops) = $self->{annfilter}->it(@_ );
809 return unless $filter;
812 unless ($self->{ann}) {
813 return if $_[0] ne $main::myalias && $_[0] ne $main::mycall;
815 return if $target eq 'SYSOP' && $self->{priv} < 5;
816 my $buf = "$to$target de $_[0]: $text";
818 $buf .= "\a\a" if $self->{beep};
819 $self->local_send($target eq 'WX' ? 'W' : 'N', $buf);
833 return unless grep uc $_ eq $target, @{$self->{user}->{group}};
835 $text =~ s/^\#\d+ //;
836 my $buf = "$target de $_[0]: $text";
838 $buf .= "\a\a" if $self->{beep};
839 $self->local_send('C', $buf);
846 my $t = ztime($_[2]);
848 my $clth = $self->{consort} eq 'local' ? 29 : 30;
849 my $comment = substr $_[3], 0, $clth;
850 $comment .= ' ' x ($clth - length($comment));
851 if ($self->{user}->wantgrid) {
852 my $ref = DXUser->get_current($_[4]);
854 $loc = $ref->qra || '';
855 $loc = ' ' . substr($loc, 0, 4) if $loc;
859 if ($self->{user}->wantdxitu) {
860 $loc = ' ' . sprintf("%2d", $_[10]) if defined $_[10];
861 $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . sprintf("%2d", $_[8]) if defined $_[8];
862 } elsif ($self->{user}->wantdxcq) {
863 $loc = ' ' . sprintf("%2d", $_[11]) if defined $_[11];
864 $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . sprintf("%2d", $_[9]) if defined $_[9];
865 } elsif ($self->{user}->wantusstate) {
866 $loc = ' ' . $_[13] if $_[13];
867 $comment = substr($comment, 0, $self->{consort} eq 'local' ? 26 : 27) . ' ' . $_[12] if $_[12];
870 return sprintf "DX de %-7.7s%11.1f %-12.12s %-s $t$loc", "$_[4]:", $_[0], $_[1], $comment;
879 return unless $self->{dx};
883 if ($self->{spotsfilter}) {
884 ($filter, $hops) = $self->{spotsfilter}->it(@_ );
885 return unless $filter;
888 dbg('spot: "' . join('","', @_) . '"') if isdbg('dxspot');
891 if ($self->{ve7cc}) {
892 $buf = VE7CC::dx_spot($self, @_);
894 $buf = $self->format_dx_spot(@_);
895 $buf .= "\a\a" if $self->{beep};
899 $self->local_send('X', $buf);
909 return unless $self->{wwv};
911 if ($self->{wwvfilter}) {
912 ($filter, $hops) = $self->{wwvfilter}->it(@_ );
913 return unless $filter;
916 my $buf = "WWV de $_[6] <$_[1]>: SFI=$_[2], A=$_[3], K=$_[4], $_[5]";
917 $buf .= "\a\a" if $self->{beep};
918 $self->local_send('V', $buf);
928 return unless $self->{wcy};
930 if ($self->{wcyfilter}) {
931 ($filter, $hops) = $self->{wcyfilter}->it(@_ );
932 return unless $filter;
935 my $buf = "WCY de $_[10] <$_[1]> : K=$_[4] expK=$_[5] A=$_[3] R=$_[6] SFI=$_[2] SA=$_[7] GMF=$_[8] Au=$_[9]";
936 $buf .= "\a\a" if $self->{beep};
937 $self->local_send('Y', $buf);
940 # broadcast debug stuff to all interested parties
943 my $s = shift; # the line to be rebroadcast
945 foreach my $dxchan (DXChannel->get_all) {
946 next unless $dxchan->{enhanced} && $dxchan->{senddbg};
947 $dxchan->send_later('L', $s);
957 if ($self->state eq 'enterbody') {
958 my $loc = $self->{loc} || confess "local var gone missing" ;
959 if ($line eq "\032" || $line eq '%1A' || uc $line eq "/EX") {
961 push @out, &{$loc->{endaction}}($self); # like this for < 5.8.0
963 $self->state('prompt');
964 } elsif ($line eq "\031" || uc $line eq "/ABORT" || uc $line eq "/QUIT") {
965 push @out, $self->msg('m10');
966 delete $loc->{lines};
969 $self->state('prompt');
971 push @{$loc->{lines}}, length($line) > 0 ? $line : " ";
972 # i.e. it ain't and end or abort, therefore store the line
975 confess "Invalid state $self->{state}";
980 sub store_startup_script
983 my $loc = $self->{loc} || confess "local var gone missing" ;
985 my $call = $loc->{call} || confess "callsign gone missing";
986 confess "lines array gone missing" unless ref $loc->{lines};
987 my $r = Script::store($call, $loc->{lines});
990 push @out, $self->msg('m19', $call, $r);
992 push @out, $self->msg('m20', $call);
995 push @out, "error opening startup script $call $!";