Diff for /doc/loncapafiles/updatequery.piml between versions 1.19 and 1.20

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(&lt;&lt;END);    print(&lt;&lt;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(&lt;&lt;END);
   
   **** Domain Description ****
   String describing the domain, to be shown to users.
   [Example, msu is Michigan State University]
   ENTER DOMAIN DESCRIPTION:
   END
   
     my $choice=&lt;&gt;;
     chomp($choice);
     if ($choice!~/:/) {
       open(OUT,'&gt;&gt;/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(&lt;&lt;END);    print(&lt;&lt;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=&lt;&gt;;  my $choice=&lt;&gt;;
 chomp($choice);  chomp($choice);
   if ($choice==1) {    if ($choice==1) {
   print(&lt;&lt;END);    print(&lt;&lt;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=&lt;&gt;;      my $choice2=&lt;&gt;;
     chomp($choice2);      chomp($choice2);
Line 405  END Line 438  END
   }    }
   elsif ($choice==2) {    elsif ($choice==2) {
   print(&lt;&lt;END);    print(&lt;&lt;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=&lt;&gt;;      my $choice2=&lt;&gt;;
     chomp($choice2);      chomp($choice2);
     $perlvar{'lonHostID'}=$choice2;      $domainDescription=$choice2;
   }    }
   elsif ($choice==3) {    elsif ($choice==3) {
   print(&lt;&lt;END);    print(&lt;&lt;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=&lt;&gt;;      my $choice2=&lt;&gt;;
     chomp($choice2);      chomp($choice2);
     $perlvar{'lonAdmEMail'}=$choice2;      $perlvar{'lonHostID'}=$choice2;
   }    }
   elsif ($choice==4) {    elsif ($choice==4) {
   print(&lt;&lt;END);    print(&lt;&lt;END);
 4) Role: $perlvar{'lonRole'}  4) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'}
 ENTER NEW VALUE:  ENTER NEW VALUE:
 END  END
     my $choice2=&lt;&gt;;      my $choice2=&lt;&gt;;
     chomp($choice2);      chomp($choice2);
     $perlvar{'lonRole'}=$choice2;      $perlvar{'lonAdmEMail'}=$choice2;
   }    }
   elsif ($choice==5) {    elsif ($choice==5) {
   print(&lt;&lt;END);    print(&lt;&lt;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=&lt;&gt;;      my $choice2=&lt;&gt;;
     chomp($choice2);      chomp($choice2);
     $perlvar{'lonExpire'}=$choice2;      $perlvar{'lonRole'}=$choice2;
   }    }
   elsif ($choice==6) {    elsif ($choice==6) {
   print(&lt;&lt;END);    print(&lt;&lt;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=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonExpire'}=$choice2;
     }
     elsif ($choice==7) {
     print(&lt;&lt;END);
   7) Server Load: $perlvar{'lonLoadLim'}
 ENTER NEW VALUE:  ENTER NEW VALUE:
 END  END
     my $choice2=&lt;&gt;;      my $choice2=&lt;&gt;;
     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,'&gt;&gt;../new_'.$lonCluster.'_hosts.tab') or         open(OUT,'&gt;&gt;../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

Removed from v.1.19  
changed lines
  Added in v.1.20


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>