#!/usr/local/bin/perl ################################################################################ # # RCS: $Id: $ # Author: Geir Inge Jensen # Created: Wed Jan 10 16:26:26 1996 # Modified: Thu Feb 22 20:02:55 1996 (geiri@orjanr.cs.uit.no) # Description: Tacoma scripts to HTML filter # # (c) Copyright 1996, Tacoma Project, all rights reserved. # ################################################################################ die "USAGE: $0 " unless -f ($ARGV[0]); $TMPDIR = '/tmp'; $BROWSER = 'netscape'; $URL = 'http://tacoma.cs.uit.no/tacweb/'; $TACOMA = 'http://tacoma.cs.uit.no/DOS/Tacoma/'; $PGP = 'pgp -sa +armorlines=0'; sub TACOMA_PreHeader { print FILE "TACOMA HTML gateway filter\n"; print FILE "

TACOMA HTML gateway filter

\n"; print FILE "Click on the following link to send the TACOMA agent "; print FILE "<$ARGV[0]> on a mission!

\n"; print FILE "

\n"; print FILE "\n"; print FILE "\n"; print FILE "
\n"; print FILE "
The Tacoma project\n"; print FILE "\n"; } sub TACOMA_Encode { local($variable) = @_; $variable =~ s/\n/\%0A/g; return $variable; } sub TACOMA_MarshallCode { local($line); while () { $line = &TACOMA_Encode($_); print FILE "$line"; } } sub TACOMA_PGPSign { local($filename) = @_; print "TACOMA must check that you have legible access.\n"; print "Please fill in your PGP pass phrase to sign the agent code!\n\n\n"; system("$PGP $filename"); return("$filename" . ".asc"); } $inputfile = &TACOMA_PGPSign($ARGV[0]); open(INPUT, "<$inputfile") || die "Unable to read input file: $!"; open(FILE, ">$TMPDIR/TacomaHTML.$$") || die "Unable to open file: $!"; &TACOMA_PreHeader(); &TACOMA_MarshallCode(); &TACOMA_PostHeader(); close(INPUT); close(FILE); print "\n\nStarting up the Web browser...\n"; system("$BROWSER $TMPDIR/TacomaHTML.$$"); unlink("$TMPDIR/TacomaHTML.$$"); unlink("$inputfile"); exit 0;