[LON-CAPA-cvs] cvs: loncom / CrGenerate.pl
foxr
lon-capa-cvs@mail.lon-capa.org
Fri, 02 Jul 2004 09:43:41 -0000
foxr Fri Jul 2 05:43:41 2004 EDT
Modified files:
/loncom CrGenerate.pl
Log:
Code the cleanup function.
Add use lib '/home/httpd/lib/perl'
I have a chicken and egg problem that I can't figure out where this is with
without already knowing where this is... If there's a better way to ensure
that I get these libs. Plese let me know.
Index: loncom/CrGenerate.pl
diff -u loncom/CrGenerate.pl:1.5 loncom/CrGenerate.pl:1.6
--- loncom/CrGenerate.pl:1.5 Thu Jul 1 06:58:29 2004
+++ loncom/CrGenerate.pl Fri Jul 2 05:43:40 2004
@@ -2,7 +2,7 @@
# The LearningOnline Network
# CrGenerate - Generate a loncapa certificate request.
#
-# $Id: CrGenerate.pl,v 1.5 2004/07/01 10:58:29 foxr Exp $
+# $Id: CrGenerate.pl,v 1.6 2004/07/02 09:43:40 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,6 +48,7 @@
# Import section:
use strict;
+use lib '/home/httpd/lib/perl';
use MIME::Entity;
use LONCAPA::Configuration;
use File::Copy;
@@ -409,7 +410,23 @@
Debug("Done");
}
-sub Cleanup {}
+
+#
+# Cleans up the detritus that's been created by this
+# script (see Implicit inputs below).
+# Implicit inputs:
+# request.pem - Name of certificate request file in PEM format
+# which will be deleted.
+# request.txt - Name of textual equivalent of request file
+# which will also be deleted.
+# hostkey.pem - Encrypted host key which will be deleted.
+# hostkey.dec - Decoded host key, which will be deleted.
+#
+sub Cleanup {
+ Debug("Cleaning up generated, temporary files");
+ unlink("request.pem", "request.txt", "hostkey.pem", "hostkey.dec");
+ Debug("done!");
+}