version 1.2, 2002/02/19 20:23:59
|
version 1.6, 2003/02/03 18:03:52
|
Line 6 $|=1;
|
Line 6 $|=1;
|
# (Running loncron |
# (Running loncron |
# 09/06/01 Gerd Kortemeyer) |
# 09/06/01 Gerd Kortemeyer) |
# 02/18/02,02/19/02 Gerd Kortemeyer) |
# 02/18/02,02/19/02 Gerd Kortemeyer) |
# |
|
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA::Configuration; |
|
|
use LWP::UserAgent(); |
use LWP::UserAgent(); |
use HTTP::Headers; |
use HTTP::Headers; |
use IO::File; |
use IO::File; |
Line 14 use Net::Ping;
|
Line 17 use Net::Ping;
|
|
|
sub online { |
sub online { |
my $host=shift; |
my $host=shift; |
|
return 1; |
|
# ping is broken |
my $p=Net::Ping->new("tcp",10); |
my $p=Net::Ping->new("tcp",10); |
my $online=$p->ping("$host"); |
my $online=$p->ping("$host"); |
$p->close(); |
$p->close(); |
Line 50 sub connected {
|
Line 55 sub connected {
|
|
|
print "Content-type: text/html\n\n". |
print "Content-type: text/html\n\n". |
"<html><body bgcolor=#FFFFFF>\n"; |
"<html><body bgcolor=#FFFFFF>\n"; |
# ------------------------------------------------------------ Read access.conf |
# -------------------- Read loncapa.conf (and by default, loncapa_apache.conf). |
{ |
my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf'); |
my $config=IO::File->new("/etc/httpd/conf/access.conf"); |
my %perlvar=%{$perlvarref}; |
|
undef $perlvarref; # remove since sensitive and not needed |
while (my $configline=<$config>) { |
delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed |
if ($configline =~ /PerlSetVar/) { |
delete $perlvar{'lonSqlAccess'}; # remove since sensitive and not needed |
my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); |
|
$perlvar{$varname}=$varvalue; |
|
} |
|
} |
|
delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed |
|
delete $perlvar{'lonSqlAccess'}; # remove since sensitive and not needed |
|
} |
|
|
|
# ------------------------------------------------------------- Read hosts file |
# ------------------------------------------------------------- Read hosts file |
{ |
{ |