3 # Take a 2 line keps email file on STDIN, prepare it for import into standard import directory
4 # and then shove it there, marked for SB ALL.
6 # Copyright (c) 2004 Dirk Koopman G1TLH
15 # search local then perl directories
17 # root of directory tree for this system
19 $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
21 unshift @INC, "$root/perl"; # this IS the right way round!
22 unshift @INC, "$root/local";
25 my $fromcall = shift || 'G1TLH';
32 # is it a 2 line kep file?
33 if ($inp =~ /ubject:\s+\[keps\]\s+orb\d{5}\.2l\.amsat/) {
46 # chop off most of the beginning
47 return unless $inp =~ s/^.*SB\s+KEPS\s+\@\s+AMSAT\s+\$ORB\d{5}\.\w/SB ALL < $fromcall/s;
48 return unless $inp =~ s/2Line\s+Orbital\s+Elements/2Line Keps/;
50 # open the output file in the data area
51 my $fn = "$root/tmp/keps.txt.$$";
52 open OUT, ">$fn" or die "$fn $!";
57 link $fn, "$root/msg/import/keps.txt.$$";