X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fload%2Fkeps.pl;h=83547dfa1ab7d436511fa76166d9e32ac9a60ba8;hb=0c1082247c57a0ec2fa35a0a81af54b1e6ac2b89;hp=71229e1d8a8165e062d1dd2a2d479f64ddb2e1a1;hpb=9cac31473878fc88778cb13d843fa77c5fd33d65;p=spider.git diff --git a/cmd/load/keps.pl b/cmd/load/keps.pl index 71229e1d..83547dfa 100644 --- a/cmd/load/keps.pl +++ b/cmd/load/keps.pl @@ -1,8 +1,20 @@ # # load the the keps file after changing it # -my $self = shift; -return (1, $self->msg('e5')) if $self->priv < 9; +my ($self, $line) = @_; +return (1, $self->msg('e5')) if $self->priv < 5; + +if ($line =~ /^(\d+)$/) { + my $msgno = $1; + my $mref = DXMsg::get($msgno); + return (1, $self->msg('m4', $msgno)) unless $mref; + return (1, $self->msg('sat5')) unless $mref->subject =~ /\b\d{3,6}\.AMSAT\b/i; + my $fn = DXMsg::filename($msgno); + my $fh = new IO::File "$main::root/perl/convkeps.pl $fn |"; + my @in = <$fh>; + $fh->close; + return (1, @in) if @in; +} my @out = Sun::load($self); @out = ($self->msg('ok')) if !@out; return (1, @out);