version 1.19, 2002/09/08 23:57:51
|
version 1.20, 2002/12/09 18:37:15
|
Line 55 sleep(3);
|
Line 55 sleep(3);
|
<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; |
|
my $domainDescription; |
unless (-e "<TARGET />") { |
unless (-e "<TARGET />") { |
print(<<END); |
print(<<END); |
WELCOME TO LON-CAPA! |
WELCOME TO LON-CAPA! |
Line 175 END
|
Line 176 END
|
} |
} |
} |
} |
|
|
|
|
|
# get domain description |
|
# accept if valid, if not valid, tell user and repeat |
|
$flag=0; |
|
|
|
while (!$flag) { |
|
print(<<END); |
|
|
|
**** Domain Description **** |
|
String describing the domain, to be shown to users. |
|
[Example, msu is Michigan State University] |
|
ENTER DOMAIN DESCRIPTION: |
|
END |
|
|
|
my $choice=<>; |
|
chomp($choice); |
|
if ($choice!~/:/) { |
|
open(OUT,'>>/tmp/loncapa_updatequery.out'); |
|
print(OUT 'domainDescription'."\t".$choice."\n"); |
|
close(OUT); |
|
$domainDescription=$choice; |
|
$flag=1; |
|
} |
|
else { |
|
print "Invalid input (no ':' allowed).\n"; |
|
} |
|
} |
|
|
my $lonHostID; |
my $lonHostID; |
if ($lonDefDomain) { |
if ($lonDefDomain) { |
$lonHostID=$lonDefDomain.$r.int(1+rand(9)); # should be probably also detect |
$lonHostID=$lonDefDomain.$r.int(1+rand(9)); # should be probably also detect |
Line 358 while (!$flag) {
|
Line 387 while (!$flag) {
|
=============================================================================== |
=============================================================================== |
This is now the current configuration of your machine. |
This is now the current configuration of your machine. |
1) Domain Name: $perlvar{'lonDefDomain'} |
1) Domain Name: $perlvar{'lonDefDomain'} |
2) Machine Name: $perlvar{'lonHostID'} |
2) Domain Description: $domainDescription |
3) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'} |
3) Machine Name: $perlvar{'lonHostID'} |
4) Role: $perlvar{'lonRole'} |
4) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'} |
5) Cache Expiration Time: $perlvar{'lonExpire'} |
5) Role: $perlvar{'lonRole'} |
6) Server Load: $perlvar{'lonLoadLim'} |
6) Cache Expiration Time: $perlvar{'lonExpire'} |
7) Everything is correct up above |
7) Server Load: $perlvar{'lonLoadLim'} |
|
8) Everything is correct up above |
END |
END |
my $hbug=-1; |
my $hbug=-1; |
my $dbug=-1; |
my $dbug=-1; |
Line 390 if ($dbug) {
|
Line 420 if ($dbug) {
|
} |
} |
|
|
print(<<END); |
print(<<END); |
ENTER A CHOICE OF 1-6 TO CHANGE, otherwise ENTER 7: |
ENTER A CHOICE OF 1-7 TO CHANGE, otherwise ENTER 8: |
END |
END |
my $choice=<>; |
my $choice=<>; |
chomp($choice); |
chomp($choice); |
if ($choice==1) { |
if ($choice==1) { |
print(<<END); |
print(<<END); |
1) Domain Name: $perlvar{'lonDefDomain'} |
1) Domain Name: $perlvar{'lonDefDomain'} |
ENTER NEW VALUE: |
ENTER NEW VALUE (this is an internal value used to identify a group of |
|
LON-CAPA machines, it must be alphanumerical, we suggest |
|
using a part of your actual DNS domain. For example, for |
|
the machine loncapa.msu.edu, we set the Domain to msu): |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
Line 405 END
|
Line 438 END
|
} |
} |
elsif ($choice==2) { |
elsif ($choice==2) { |
print(<<END); |
print(<<END); |
2) Machine Name: $perlvar{'lonHostID'} |
2) Domain Description: $domainDescription |
ENTER NEW VALUE: |
ENTER NEW VALUE (this should be a string that describes your domain, spaces |
|
and punctuation are fine except for ':'): |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonHostID'}=$choice2; |
$domainDescription=$choice2; |
} |
} |
elsif ($choice==3) { |
elsif ($choice==3) { |
print(<<END); |
print(<<END); |
3) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'} |
3) Machine Name: $perlvar{'lonHostID'} |
ENTER NEW VALUE: |
ENTER NEW VALUE (this will be the name of the machine in the LON-CAPA network |
|
it cannot contain any of '_' '-' '.' or ':'. We suggest that |
|
if you are in the domain 'example' and are the first library |
|
server you enter 'examplel1') : |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonAdmEMail'}=$choice2; |
$perlvar{'lonHostID'}=$choice2; |
} |
} |
elsif ($choice==4) { |
elsif ($choice==4) { |
print(<<END); |
print(<<END); |
4) Role: $perlvar{'lonRole'} |
4) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'} |
ENTER NEW VALUE: |
ENTER NEW VALUE: |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonRole'}=$choice2; |
$perlvar{'lonAdmEMail'}=$choice2; |
} |
} |
elsif ($choice==5) { |
elsif ($choice==5) { |
print(<<END); |
print(<<END); |
5) Cache Expiration Time: $perlvar{'lonExpire'} |
5) Role: $perlvar{'lonRole'} |
ENTER NEW VALUE: |
ENTER NEW VALUE (this should be either 'access' or 'library' |
|
if in doubt select 'library'): |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonExpire'}=$choice2; |
$perlvar{'lonRole'}=$choice2; |
} |
} |
elsif ($choice==6) { |
elsif ($choice==6) { |
print(<<END); |
print(<<END); |
6) Server Load: $perlvar{'lonLoadLim'} |
6) Cache Expiration Time: $perlvar{'lonExpire'} |
|
ENTER NEW VALUE (in seconds, 86400 is a reasonable value): |
|
END |
|
my $choice2=<>; |
|
chomp($choice2); |
|
$perlvar{'lonExpire'}=$choice2; |
|
} |
|
elsif ($choice==7) { |
|
print(<<END); |
|
7) Server Load: $perlvar{'lonLoadLim'} |
ENTER NEW VALUE: |
ENTER NEW VALUE: |
END |
END |
my $choice2=<>; |
my $choice2=<>; |
chomp($choice2); |
chomp($choice2); |
$perlvar{'lonLoadLim'}=$choice2; |
$perlvar{'lonLoadLim'}=$choice2; |
} |
} |
elsif ($choice==7) { |
elsif ($choice==8) { |
$flag=1; |
$flag=1; |
} |
} |
else { |
else { |
Line 559 END
|
Line 606 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 |