From 8937c829bc3f6c4f2546621a3a209aae90333647 Mon Sep 17 00:00:00 2001 From: Tim Bishop Date: Thu, 26 Oct 2000 00:16:37 +0000 Subject: [PATCH] Extracts a copy of the website (from a tar file) onto the webserver. --- cgi-bin/cvswww-extract.cgi | 117 +++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100755 cgi-bin/cvswww-extract.cgi diff --git a/cgi-bin/cvswww-extract.cgi b/cgi-bin/cvswww-extract.cgi new file mode 100755 index 0000000..6383c06 --- /dev/null +++ b/cgi-bin/cvswww-extract.cgi @@ -0,0 +1,117 @@ +#!/usr/bin/perl + +#--------------------------------------------------------- +# cvswww-extract.cgi +# +# Script to extract webpages onto webserver +# Written by Tim Bishop [tdb1@ukc.ac.uk] 20/10/2000 +# +# Copyright i-Scream, 2000 +# http://www.i-scream.org.uk +#--------------------------------------------------------- + +#grab some info +use CGI; +$query=new CGI; +$site=$query->param('site'); + +# Settings +if(-e "/usr/local/proj/co600_10" && -d "/usr/local/proj/co600_10"){ + # Assuming on Raptor + my ($left) = "../webpages/left.inc"; + my ($title) = "../webpages/title.inc"; + my ($bottom) = "../webpages/bottom.inc"; +} +elsif (-e "/home/sites/www.i-scream.org.uk" && -d "/home/sites/www.i-scream.org.uk"){ + # Assuming on Main Site + my ($left) = "../left.inc"; + my ($title) = "../title.inc"; + my ($bottom) = "../bottom.inc"; +} + +print "Content-type: text/html\n\n"; + +print << "EOF"; + + + + + + + + The i-Scream Project CVS Website Extracter! + + + + + + + + + +
+EOF + +&print_file($left); + +print << "EOF"; + + +EOF + +&print_file($title); + +print "
\n";
+
+#decide which site we're running on
+if($site eq "raptor" && -e "/usr/local/proj/co600_10" && -d "/usr/local/proj/co600_10"){
+
+print "Debugging output from run on Raptor:\n";
+print `/usr/local/proj/co600_10/scripts/cvswww-extract-cmd`;
+
+print "\nDebugging output from cleanup:\n";
+print `/usr/local/proj/co600_10/scripts/cvswww-clean`;
+
+}
+elsif($site eq "main" && -e "/home/sites/www.i-scream.org.uk" && -d "/home/sites/www.i-scream.org.uk"){
+
+print "Debugging output from extract:\n";
+print `cd /home/sites/www.i-scream.org.uk/web && gunzip cvswww-extract.tar.gz && tar -xvf cvswww-extract.tar && rm -f cvswww-extract.tar`;
+
+}
+else{
+    print "whoops, forget to say which site... or you lied :)\n";
+}
+
+print "
\n"; + +&print_file($bottom); + +print << "EOF"; + +
+ + + + +EOF + +exit 0; + +sub print_file ($) { + my ($filename) = @_; + print `cat $filename`; +} + +sub print_file_old ($) { + my ($filename) = @_; + open(FILE, $filename) or die "Cannot open $filename: $!\n"; + while (my ($line) = ) { + print $line; + } +} -- 2.44.0