X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fimportkeps.pl;h=3ce83317e2e30695b937f264a8bc128dbbbf37a0;hb=766014807e2521cc60a219c6eda5b49d13ffc70f;hp=427871673d5398952d57e145d9448390cd2e8ae0;hpb=8216591f8355cc88b277c25a854527408bce8a3d;p=spider.git diff --git a/perl/importkeps.pl b/perl/importkeps.pl index 42787167..3ce83317 100644 --- a/perl/importkeps.pl +++ b/perl/importkeps.pl @@ -1,11 +1,11 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Take a 2 line keps email file on STDIN, prepare it for import into standard import directory # and then shove it there, marked for SB ALL. # -# Copyright (c) Dirk Koopman G1TLH +# Copyright (c) 2004 Dirk Koopman G1TLH +# # -# $Id$ # use strict; @@ -22,7 +22,7 @@ BEGIN { unshift @INC, "$root/local"; } - +my $fromcall = shift || 'G1TLH'; my $inp; { local $/ = undef; @@ -44,12 +44,13 @@ exit(0); sub process { # chop off most of the beginning - return unless $inp =~ s/^.*SB\s+KEPS\s+\@\s+AMSAT\s+\$ORB\d{5}\.\w/SB ALL/s; + return unless $inp =~ s/^.*SB\s+KEPS\s+\@\s+AMSAT\s+\$ORB\d{5}\.\w/SB ALL < $fromcall/s; return unless $inp =~ s/2Line\s+Orbital\s+Elements/2Line Keps/; # open the output file in the data area - my $fn = "$root/data/keps.txt.$$"; + my $fn = "$root/tmp/keps.txt.$$"; open OUT, ">$fn" or die "$fn $!"; + chmod 0666, $fn; print OUT $inp; close OUT;