2 # module to do startup script handling
4 # Copyright (c) 2001 Dirk Koopman G1TLH
20 use vars qw($VERSION $BRANCH);
21 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
22 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
23 $main::build += $VERSION;
24 $main::branch += $BRANCH;
26 my $base = "$main::root/scripts";
32 my $fn = "$base/$script";
34 my $fh = new IO::File $fn;
35 return undef unless $fh;
36 my $self = bless {call => $script}, $pkg;
43 $self->{lines} = \@lines;
51 foreach my $l (@{$self->{lines}}) {
52 unless ($l =~ /^\s*\#/ || $l =~ /^\s*$/) {
53 my @out = DXCommandmode::run_cmd($dxchan, $l);
54 if ($dxchan->can('send_ans')) {
55 $dxchan->send_ans(@out);
59 last if @out && $l =~ /^pri?v?/i;