Diff for /doc/loncapafiles/updatequery.piml between versions 1.21 and 1.22

version 1.21, 2002/12/09 18:54:40 version 1.22, 2002/12/09 21:10:44
Line 52  sleep(3); Line 52  sleep(3);
 </perlscript>  </perlscript>
 </file>  </file>
 <file>  <file>
   <target dist='default'>loncom/hosts.tab</target>
   <perlscript mode='fg'>
   unless (-l "<TARGET />") {
     print(&lt;&lt;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=&lt;&gt;;
     chomp($choice);
     if ($choice==1) {
       $lonCluster='production'; $flag=1;
     }
     elsif ($choice==2) {
    die("FIXME Broken!!!");
       $lonCluster='standalone'; $flag=1;
       open(OUT,'&gt;../'.$lonCluster.'_hosts.tab') or
         die('file generation error');
         print(OUT $line2insert);
       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 &lt;&lt;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 440  my %perlvarstatic;
  }   }
  close(CONFIG);   close(CONFIG);
     }      }
       unless ($domainDescription) {
          open(IN,'&lt;../'.$lonCluster.'_hosts.tab');
          while(&lt;IN&gt;) {
             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 592  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(&lt;&lt;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);  
 $hostaddress=~s/\s//;  
 $flag=0;  
 while (!$flag) {  
   print "ENTER 1, 2, 3, or 4:\n";  
   my $choice=&lt;&gt;;  
   chomp($choice);  
   $line2insert=&lt;&lt;END;  
 $perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription  
 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=&lt;&lt;END;
     $lonCluster='production'; $flag=1;  $perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress:$domainDescription
   }  
   elsif ($choice==2) {  
     $lonCluster='standalone'; $flag=1;  
     open(OUT,'&gt;../'.$lonCluster.'_hosts.tab') or  
       die('file generation error');  
       print(OUT $line2insert);  
     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 &lt;&lt;END;  
 There is no existing /home/httpd/lonTabs/hosts.tab  
 END  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,'&lt;../'.$lonCluster.'_hosts.tab');      open(IN,'&lt;../'.$lonCluster.'_hosts.tab');
Line 636  END Line 656  END
     }      }
   }    }
 }  }
   
 }  
 </perlscript>  </perlscript>
 </file>  </file>
 </files>  </files>

Removed from v.1.21  
changed lines
  Added in v.1.22


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