From 075911f8baa83ef183975bf103709e7a050d0def Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Mon, 20 Jan 2014 17:23:44 +0100 Subject: [PATCH] modified web commands to run in apache and httpi --- web/htdocs/index.pl | 3 ++- web/htdocs/mvd/cb_controller.pl | 13 ++++++++++--- web/htdocs/mvd/jtag.pl | 13 ++++++++++--- web/htdocs/mvd/roc.pl | 13 ++++++++++--- web/htdocs/network/generic.pl | 13 ++++++++++--- web/htdocs/network/hub.pl | 13 ++++++++++--- web/htdocs/network/trbnet.pl | 13 ++++++++++--- web/htdocs/nxyter/index.pl | 13 ++++++++++--- web/htdocs/tdc/tdcstatctrl.pl | 13 ++++++++++--- 9 files changed, 82 insertions(+), 25 deletions(-) diff --git a/web/htdocs/index.pl b/web/htdocs/index.pl index 9925f91..33ebd91 100755 --- a/web/htdocs/index.pl +++ b/web/htdocs/index.pl @@ -1,11 +1,12 @@ #!/usr/bin/perl +use CGI::Carp qw(warningsToBrowser fatalsToBrowser); if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { print "HTTP/1.0 200 OK\n"; print header("text/html"); } else { print "Content-type: text/html\n\n"; - use if (!$ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i), apacheEnv; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; } diff --git a/web/htdocs/mvd/cb_controller.pl b/web/htdocs/mvd/cb_controller.pl index 6f4fcde..50b9642 100755 --- a/web/htdocs/mvd/cb_controller.pl +++ b/web/htdocs/mvd/cb_controller.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/mvd/jtag.pl b/web/htdocs/mvd/jtag.pl index 0b8477a..0b528d5 100755 --- a/web/htdocs/mvd/jtag.pl +++ b/web/htdocs/mvd/jtag.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/mvd/roc.pl b/web/htdocs/mvd/roc.pl index b290bf9..194ba2f 100755 --- a/web/htdocs/mvd/roc.pl +++ b/web/htdocs/mvd/roc.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/network/generic.pl b/web/htdocs/network/generic.pl index 55156bf..cb3e070 100755 --- a/web/htdocs/network/generic.pl +++ b/web/htdocs/network/generic.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/network/hub.pl b/web/htdocs/network/hub.pl index 3e23e28..9fa929f 100755 --- a/web/htdocs/network/hub.pl +++ b/web/htdocs/network/hub.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/network/trbnet.pl b/web/htdocs/network/trbnet.pl index 2a89f94..71e48b1 100755 --- a/web/htdocs/network/trbnet.pl +++ b/web/htdocs/network/trbnet.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/nxyter/index.pl b/web/htdocs/nxyter/index.pl index 52f2bb1..f4e8f23 100755 --- a/web/htdocs/nxyter/index.pl +++ b/web/htdocs/nxyter/index.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; diff --git a/web/htdocs/tdc/tdcstatctrl.pl b/web/htdocs/tdc/tdcstatctrl.pl index f5cc415..0de51ed 100755 --- a/web/htdocs/tdc/tdcstatctrl.pl +++ b/web/htdocs/tdc/tdcstatctrl.pl @@ -1,6 +1,13 @@ -&htsponse(200, "OK"); -print "Content-type: text/html\r\n\r\n"; - +#!/usr/bin/perl +if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) { + print "HTTP/1.0 200 OK\n"; + print header("text/html"); + } +else { + use lib '..'; + use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv; + print "Content-type: text/html\n\n"; + } use CGI ':standard'; use XML::LibXML; -- 2.43.0