version 1.25, 2003/05/08 22:16:23
|
version 1.28, 2003/08/29 18:54:52
|
Line 57 unless (-l "<TARGET />") {
|
Line 57 unless (-l "<TARGET />") {
|
print(<<END); |
print(<<END); |
|
|
=============================================================================== |
=============================================================================== |
What hosts.tab would you like to have installed? |
What hosts.tab and domain.tab would you like to have installed? |
(hosts.tab is a listing of all other internet machines |
(hosts.tab is a listing of all other internet machines |
that a server system considers to be valid server systems |
that a server system considers to be valid server systems |
on the LON-CAPA network) |
on the LON-CAPA network |
|
domain.tab is a description of the internal LON-CAPA domains) |
|
|
1) PRODUCTION - you want to deliver courses today or sometime very soon |
1) PRODUCTION - you want to deliver courses today or sometime very soon |
on this machine |
on this machine |
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
2) STAND-ALONE - you want this machine to run in 'stand-alone' mode and |
not be connected to other LON-CAPA machines for now |
not be connected to other LON-CAPA machines for now |
3) DEVELOPMENT - you want to play with or explore LON-CAPA |
3) DEVELOPMENT - you want to play with or explore LON-CAPA |
4) PRESERVE the existing hosts.tab (/home/httpd/lonTabs/hosts.tab) |
4) PRESERVE the existing hosts.tab and domain.tab |
|
(/home/httpd/lonTabs/hosts.tab and |
|
/home/httpd/lonTabs/domain.tab) |
|
|
END |
END |
# Option number 26 will install rawhide_hosts.tab, but |
# Option number 26 will install rawhide_hosts.tab, but |
Line 101 There is no existing /home/httpd/lonTabs
|
Line 104 There is no existing /home/httpd/lonTabs
|
END |
END |
die(''); |
die(''); |
} |
} |
|
if (-e '/home/httpd/lonTabs/domain.tab') { |
|
`cp /home/httpd/lonTabs/domain.tab ../existing_domain.tab`; |
|
} |
|
else { |
|
print <<END; |
|
There is no existing /home/httpd/lonTabs/domain.tab |
|
END |
|
die(''); |
|
} |
} |
} |
elsif ($choice==26) { |
elsif ($choice==26) { |
$lonCluster='rawhide'; $flag=1; |
$lonCluster='rawhide'; $flag=1; |
Line 441 my %perlvarstatic;
|
Line 453 my %perlvarstatic;
|
close(CONFIG); |
close(CONFIG); |
} |
} |
if (!$domainDescription && $lonCluster ne 'existing') { |
if (!$domainDescription && $lonCluster ne 'existing') { |
open(IN,'<../'.$lonCluster.'_hosts.tab'); |
open(IN,'<../'.$lonCluster.'_domain.tab'); |
while(<IN>) { |
while(<IN>) { |
if (/^$perlvar{'lonHostID'}\:/) { |
if (/^$perlvar{'lonDefDomain'}\:/) { |
(undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_); |
(undef,$domainDescription)=split(/:/,$_); |
chomp($domainDescription); |
chomp($domainDescription); |
last; |
last; |
} |
} |
Line 452 my %perlvarstatic;
|
Line 464 my %perlvarstatic;
|
close(IN); |
close(IN); |
} |
} |
if (!$domainDescription) { |
if (!$domainDescription) { |
open(IN,'</home/httpd/lonTabs/hosts.tab'); |
open(IN,'</home/httpd/lonTabs/domain.tab'); |
while(<IN>) { |
while(<IN>) { |
if (/^$perlvar{'lonHostID'}\:/) { |
if (/^$perlvar{'lonDefDomain'}\:/) { |
(undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_); |
(undef,$domainDescription)=split(/:/,$_); |
chomp($domainDescription); |
chomp($domainDescription); |
last; |
last; |
} |
} |
Line 587 END
|
Line 599 END
|
print(<<END); |
print(<<END); |
8) User Load: $perlvar{'lonUserLoadLim'} |
8) User Load: $perlvar{'lonUserLoadLim'} |
Numer of users that can login before machine is 'overloaded' |
Numer of users that can login before machine is 'overloaded' |
ENTER NEW VALUE (integer value, 0 means ther is no limit): |
ENTER NEW VALUE (integer value, 0 means there is no limit): |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
Line 624 unless (-l "<TARGET />") {
|
Line 636 unless (-l "<TARGET />") {
|
$lineexistflag=0; |
$lineexistflag=0; |
$hostidexistflag=0; |
$hostidexistflag=0; |
$line2insert=<<END; |
$line2insert=<<END; |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription |
$perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress |
END |
END |
|
$domaininsert="$perlvar{'lonDefDomain'}:$domainDescription\n"; |
if ($lonCluster eq 'standalone') { |
if ($lonCluster eq 'standalone') { |
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); |
|
open(OUT,'>../'.$lonCluster.'_domain.tab') or |
|
die('file generation error'); |
|
print(OUT $domaininsert); |
|
close(OUT); |
} |
} |
if ($flag==1) { |
if ($flag==1) { |
`rm -f ../hosts.tab`; |
`rm -f ../hosts.tab`; |
Line 659 END
|
Line 676 END
|
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 |
system('ping -c 1 www.lon-capa.org > /dev/null || ping -c 1 www.msu.edu > /dev/null || ping -c 1 www.mit.edu > /dev/null'); |
system('ping -c 1 -W 5 www.lon-capa.org > /dev/null || ping -c 1 -W 5 www.msu.edu > /dev/null || ping -c 1 -W 5 www.mit.edu > /dev/null'); |
`echo "REPLACE:$lonCluster:$lonHostID:$date:$line2insert" | mail -s "REPLACE:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org` unless $?; |
`echo "REPLACE:$lonCluster:$lonHostID:$date:$line2insert" | mail -s "REPLACE:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org` unless $?; |
} |
} |
elsif ($hostidexistflag and $lineexistflag) { |
elsif ($hostidexistflag and $lineexistflag) { |
Line 684 END
|
Line 701 END
|
`echo "INSERT:$lonCluster:$lonHostID:$date:$line2insert" | mail -s "INSERT:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org`; |
`echo "INSERT:$lonCluster:$lonHostID:$date:$line2insert" | mail -s "INSERT:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org`; |
} |
} |
} |
} |
|
$lineexistflag=0; |
|
if ($flag==1) { |
|
`rm -f ../domain.tab`; |
|
open(IN,'<../'.$lonCluster.'_domain.tab'); |
|
while(<IN>) { |
|
if (/^$domaininsert$/) { |
|
$lineexistflag=1; |
|
} |
|
if (/^$perlvar{'lonDefDomain'}\:/) { |
|
$domainexistflag=1; |
|
} |
|
} |
|
close(IN); |
|
if ($domainexistflag and !$lineexistflag) { |
|
print <<END; |
|
WARNING: $perlvar{'lonDefDomain'} already exists inside |
|
loncapa/loncom/${lonCluster}_domain.tab. The entry inside |
|
${lonCluster}_domain.tab does not match your settings. |
|
The entry inside ${lonCluster}_domain.tab is being replaced |
|
with your new values. |
|
END |
|
`grep -v "$perlvar{'lonDefDomain'}:" ../${lonCluster}_domain.tab > ../new_${lonCluster}_domain.tab`; |
|
open(OUT,'>>../new_'.$lonCluster.'_domain.tab') or |
|
die("cannot open loncom/${lonCluster}_domain.tab for output\n"); |
|
print(OUT $domaininsert); |
|
close(OUT); |
|
`ln -s new_${lonCluster}_domain.tab ../domain.tab`; |
|
# email appropriate message |
|
system('ping -c 1 -W 5 www.lon-capa.org > /dev/null || ping -c 1 -W 5 www.msu.edu > /dev/null || ping -c 1 -W 5 www.mit.edu > /dev/null'); |
|
`echo "REPLACEdom:$lonCluster:$lonHostID:$date:$domaninsert" | mail -s "REPLACEdom:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org` unless $?; |
|
} |
|
elsif ($domainexistflag and $lineexistflag) { |
|
print <<END; |
|
Entry exists in ${lonCluster}_domain.tab. |
|
END |
|
`ln -s ${lonCluster}_domain.tab ../domain.tab`; |
|
# email appropriate message |
|
`echo "STABLEUPDATEdom:$lonCluster:$lonHostID:$date:$domaininsert" | mail -s "STABLEUPDATEdom:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org`; |
|
} |
|
elsif (!$domainexistflag and !$lineexistflag) { |
|
print <<END; |
|
New entry for $lonCluster. |
|
END |
|
`cat ../${lonCluster}_domain.tab > ../new_${lonCluster}_domain.tab`; |
|
open(OUT,'>>../new_'.$lonCluster.'_domain.tab') or |
|
die("cannot open loncom/new_${lonCluster}_domain.tab for output\n"); |
|
print(OUT $domaininsert); |
|
close(OUT); |
|
`ln -s new_${lonCluster}_domain.tab ../domain.tab`; |
|
# email appropriate message |
|
`echo "INSERTdom:$lonCluster:$lonHostID:$date:$domaininsert" | mail -s "INSERTdom:$lonCluster:$lonHostID:$date" installrecord\@mail.lon-capa.org`; |
|
} |
|
} |
} |
} |
</perlscript> |
</perlscript> |
</file> |
</file> |