X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fprocess_ursa.pl;h=9196169f9a8efdae19b04d595c1d01cd01311e1b;hb=refs%2Fheads%2Fstaging;hp=3416d976e58dff57defd92563ca7dd60580e67a8;hpb=45495d980ec748f19509c7668d6b92a06f216ed7;p=spider.git diff --git a/perl/process_ursa.pl b/perl/process_ursa.pl index 3416d976..9196169f 100644 --- a/perl/process_ursa.pl +++ b/perl/process_ursa.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Process and import for mail SIDC Ursagrams # @@ -8,7 +8,7 @@ # # Copyright (c) 2004 Dirk Koopman G1TLH # -# $Id$ +# # use strict; @@ -32,6 +32,7 @@ my $tmp = "$root/tmp"; my $msg = Mail::Internet->new(\*STDIN) or die "Mail::Internet $!"; my $head = $msg->head->header_hashref; +my $fromcall = shift || 'G1TLH'; if ($head && $head->{From}->[0] =~ /sidc/i && $head->{Subject}->[0] =~ /Ursigram/i) { my $body = $msg->body; @@ -46,7 +47,7 @@ if ($head && $head->{From}->[0] =~ /sidc/i && $head->{Subject}->[0] =~ /Ursigram } my $fn = "ursigram$date.txt.$$"; open OUT, ">$tmp/$fn" or die "import $tmp/$fn $!"; - print OUT "SB ALL\n$title\n"; + print OUT "SB ALL < $fromcall\n$title\n"; print OUT map {s/\r\n$/\n/; $_} @$body; print OUT "/ex\n"; close OUT;