version 1.20, 2002/12/09 18:37:15
|
version 1.24, 2003/02/03 18:03:51
|
Line 1
|
Line 1
|
<!-- updatequery.piml --> |
<!-- updatequery.piml --> |
<!-- Scott Harrison --> |
|
|
|
<!-- $Id$ --> |
<!-- $Id$ --> |
|
|
Line 52 sleep(3);
|
Line 51 sleep(3);
|
</perlscript> |
</perlscript> |
</file> |
</file> |
<file> |
<file> |
|
<target dist='default'>loncom/hosts.tab</target> |
|
<perlscript mode='fg'> |
|
unless (-l "<TARGET />") { |
|
print(<<END); |
|
|
|
=============================================================================== |
|
What hosts.tab would you like to have installed? |
|
(hosts.tab is a listing of all other internet machines |
|
that a server system considers to be valid server systems |
|
on the LON-CAPA network) |
|
|
|
1) PRODUCTION - you want to deliver courses today or sometime very soon |
|
on this machine |
|
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
|
not be connected to other LON-CAPA machines for now |
|
3) DEVELOPMENT - you want to play with or explore LON-CAPA |
|
4) PRESERVE the existing hosts.tab (/home/httpd/lonTabs/hosts.tab) |
|
|
|
END |
|
# Option number 26 will install rawhide_hosts.tab, but |
|
# the typical user does not want to be part of an intensive |
|
# machine test cluster. |
|
|
|
# get input |
|
# if valid then process, otherwise loop |
|
$flag=0; |
|
while (!$flag) { |
|
print "ENTER 1, 2, 3, or 4:\n"; |
|
my $choice=<>; |
|
chomp($choice); |
|
if ($choice==1) { |
|
$lonCluster='production'; $flag=1; |
|
} |
|
elsif ($choice==2) { |
|
$lonCluster='standalone'; $flag=1; |
|
} |
|
elsif ($choice==3) { |
|
$lonCluster='development'; $flag=1; |
|
} |
|
elsif ($choice==4) { |
|
$lonCluster='existing'; $flag=1; |
|
if (-e '/home/httpd/lonTabs/hosts.tab') { |
|
`cp /home/httpd/lonTabs/hosts.tab ../existing_hosts.tab`; |
|
} |
|
else { |
|
print <<END; |
|
There is no existing /home/httpd/lonTabs/hosts.tab |
|
END |
|
die(''); |
|
} |
|
} |
|
elsif ($choice==26) { |
|
$lonCluster='rawhide'; $flag=1; |
|
} |
|
} |
|
} |
|
</perlscript> |
|
</file> |
|
<file> |
<target dist='default'>/home/httpd/lonTabs/hosts.tab</target> |
<target dist='default'>/home/httpd/lonTabs/hosts.tab</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
$|=1; |
$|=1; |
Line 376 my %perlvarstatic;
|
Line 434 my %perlvarstatic;
|
} |
} |
close(CONFIG); |
close(CONFIG); |
} |
} |
|
if (!$domainDescription && $lonCluster ne 'existing') { |
|
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
|
while(<IN>) { |
|
if (/^$perlvar{'lonHostID'}\:/) { |
|
(undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_); |
|
chomp($domainDescription); |
|
last; |
|
} |
|
} |
|
close(IN); |
|
} |
|
if (!$domainDescription) { |
|
open(IN,'</home/httpd/lonTabs/hosts.tab'); |
|
while(<IN>) { |
|
if (/^$perlvar{'lonHostID'}\:/) { |
|
(undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_); |
|
chomp($domainDescription); |
|
last; |
|
} |
|
} |
|
close(IN); |
|
} |
|
|
# implement editing logic below, interactively |
# implement editing logic below, interactively |
# update loncapa.conf until 7 is entered |
# update loncapa.conf until 8 is entered |
|
|
$flag=0; |
$flag=0; |
|
|
Line 517 END
|
Line 598 END
|
<target dist='default'>loncom/hosts.tab</target> |
<target dist='default'>loncom/hosts.tab</target> |
<perlscript mode='fg'> |
<perlscript mode='fg'> |
unless (-l "<TARGET />") { |
unless (-l "<TARGET />") { |
print(<<END); |
my $hostname=`hostname`;chomp($hostname); |
|
my $hostaddress=`hostname -i $hostname`;chomp($hostaddress); |
=============================================================================== |
$hostaddress=~s/\s//; |
What hosts.tab would you like to have installed? |
|
(hosts.tab is a listing of all other internet machines |
|
that a server system considers to be valid server systems |
|
on the LON-CAPA network) |
|
|
|
1) PRODUCTION - you want to deliver courses today or sometime very soon |
|
on this machine |
|
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
|
not be connected to other LON-CAPA machines for now |
|
3) DEVELOPMENT - you want to play with or explore LON-CAPA |
|
4) PRESERVE the existing hosts.tab (/home/httpd/lonTabs/hosts.tab) |
|
|
|
END |
|
# Option number 26 will install rawhide_hosts.tab, but |
|
# the typical user does not want to be part of an intensive |
|
# machine test cluster. |
|
|
|
# get input |
|
# if valid then process, otherwise loop |
|
my $hostname=`hostname`;chomp($hostname); |
|
my $hostaddress=`hostname -i $hostname`;chomp($hostaddress); |
|
$flag=0; |
|
while (!$flag) { |
|
print "ENTER 1, 2, 3, or 4:\n"; |
|
my $choice=<>; |
|
chomp($choice); |
|
$line2insert=<<END; |
|
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress |
|
END |
|
$date=`date -I`; chomp($date); |
$date=`date -I`; chomp($date); |
$lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=$perlvar{'lonHostID'}; |
$lonHostID=~s/\W//g; |
$lonHostID=~s/\W//g; |
$lineexistflag=0; |
$lineexistflag=0; |
$hostidexistflag=0; |
$hostidexistflag=0; |
if ($choice==1) { |
$line2insert=<<END; |
$lonCluster='production'; $flag=1; |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription |
} |
END |
elsif ($choice==2) { |
if ($lonCluster eq 'standalone') { |
$lonCluster='standalone'; $flag=1; |
|
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
open(OUT,'>../'.$lonCluster.'_hosts.tab') or |
die('file generation error'); |
die('file generation error'); |
print(OUT $line2insert); |
print(OUT $line2insert); |
close(OUT); |
close(OUT); |
} |
} |
elsif ($choice==3) { |
|
$lonCluster='development'; $flag=1; |
|
} |
|
elsif ($choice==4) { |
|
$lonCluster='existing'; $flag=1; |
|
if (-e '/home/httpd/lonTabs/hosts.tab') { |
|
`cp /home/httpd/lonTabs/hosts.tab ../existing_hosts.tab`; |
|
} |
|
else { |
|
print <<END; |
|
There is no existing /home/httpd/lonTabs/hosts.tab |
|
END |
|
die(''); |
|
} |
|
} |
|
elsif ($choice==26) { |
|
$lonCluster='rawhide'; $flag=1; |
|
} |
|
if ($flag==1) { |
if ($flag==1) { |
`rm -f ../hosts.tab`; |
`rm -f ../hosts.tab`; |
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
Line 606 END
|
Line 639 END
|
open(OUT,'>>../new_'.$lonCluster.'_hosts.tab') or |
open(OUT,'>>../new_'.$lonCluster.'_hosts.tab') or |
die("cannot open loncom/${lonCluster}_hosts.tab for output\n"); |
die("cannot open loncom/${lonCluster}_hosts.tab for output\n"); |
print(OUT $line2insert); |
print(OUT $line2insert); |
print($line2insert); |
|
close(OUT); |
close(OUT); |
`ln -s new_${lonCluster}_hosts.tab ../hosts.tab`; |
`ln -s new_${lonCluster}_hosts.tab ../hosts.tab`; |
# email appropriate message |
# email appropriate message |
Line 626 END
|
Line 658 END
|
New entry for $lonCluster. |
New entry for $lonCluster. |
END |
END |
`cat ../${lonCluster}_hosts.tab > ../new_${lonCluster}_hosts.tab`; |
`cat ../${lonCluster}_hosts.tab > ../new_${lonCluster}_hosts.tab`; |
open(OUT,'>../new_'.$lonCluster.'_hosts.tab') or |
open(OUT,'>>../new_'.$lonCluster.'_hosts.tab') or |
die("cannot open loncom/${lonCluster}_hosts.tab for output\n"); |
die("cannot open loncom/new_${lonCluster}_hosts.tab for output\n"); |
print(OUT $line2insert); |
print(OUT $line2insert); |
close(OUT); |
close(OUT); |
`ln -s new_${lonCluster}_hosts.tab ../hosts.tab`; |
`ln -s new_${lonCluster}_hosts.tab ../hosts.tab`; |
Line 636 END
|
Line 668 END
|
} |
} |
} |
} |
} |
} |
|
|
} |
|
</perlscript> |
</perlscript> |
</file> |
</file> |
</files> |
</files> |