Diff for /doc/loncapafiles/updatequery.piml between versions 1.5 and 1.7

version 1.5, 2002/05/13 01:09:26 version 1.7, 2002/05/13 09:05:18
Line 52  sleep(3); Line 52  sleep(3);
 </perlscript>  </perlscript>
 </file>  </file>
 <file>  <file>
 <target dist='default'>/home/httpd/lonUsers2/</target>  <target dist='default'>/home/httpd/lonUsers/</target>
 <perlscript mode='fg'>  <perlscript mode='fg'>
 $|=1;  $|=1;
 unless (-e "<TARGET />") {  unless (-e "<TARGET />") {
Line 242  END Line 242  END
 }  }
   
 # update loncapa.conf  # update loncapa.conf
 #my $confdir='/etc/httpd/conf/';  my $confdir='/etc/httpd/conf/';
 my $confdir='';  #my $confdir='';
 my $filename='loncapa.conf';  my $filename='loncapa.conf';
 my %perlvar;  my %perlvar;
     if (-e "$confdir$filename") {      if (-e "$confdir$filename") {
Line 295  END Line 295  END
 <target dist='default'>/</target>  <target dist='default'>/</target>
 <perlscript mode='fg'>  <perlscript mode='fg'>
 # read values from loncapa.conf  # read values from loncapa.conf
 #my $confdir='/etc/httpd/conf/';  my $confdir='/etc/httpd/conf/';
 my $confdir='';  #my $confdir='';
 my $filename='loncapa.conf';  my $filename='loncapa.conf';
 my %perlvar;  my %perlvar;
     if (-e "$confdir$filename") {      if (-e "$confdir$filename") {
Line 311  my %perlvar; Line 311  my %perlvar;
  }   }
  close(CONFIG);   close(CONFIG);
     }      }
   my %perlvarstatic;
       if (-e "${confdir}loncapa_apache.conf") {
    open(CONFIG,'&lt;'.$confdir.'loncapa_apache.conf') or 
             die("Can't read ${confdir}loncapa_apache.conf");
    while (my $configline=&lt;CONFIG&gt;) {
       if ($configline =~ /^[^\#]*PerlSetVar/) {
    my ($unused,$varname,$varvalue)=split(/\s+/,$configline);
    chomp($varvalue);
    $perlvarstatic{$varname}=$varvalue;
       }
    }
    close(CONFIG);
       }
   # implement editing logic below, interactively
   # update loncapa.conf until 7 is entered
   
   $flag=0;
   while (!$flag) {
   print(&lt;&lt;END);    print(&lt;&lt;END);
   
 ===============================================================================  ===============================================================================
Line 322  This is now the current configuration of Line 340  This is now the current configuration of
 5) Cache Expiration Time: $perlvar{'lonExpire'}  5) Cache Expiration Time: $perlvar{'lonExpire'}
 6) Server Load: $perlvar{'lonLoadLim'}  6) Server Load: $perlvar{'lonLoadLim'}
 7) Everything is correct up above  7) Everything is correct up above
   END
     print(&lt;&lt;END);
 ENTER A CHOICE OF 1-6 TO CHANGE, otherwise ENTER 7:  ENTER A CHOICE OF 1-6 TO CHANGE, otherwise ENTER 7:
 END  END
   
 # implement editing logic below, interactively  
 # update loncapa.conf until 7 is entered  
 my $choice=&lt;&gt;;  my $choice=&lt;&gt;;
 chomp($choice);  chomp($choice);
     if ($choice==1) {
     print(&lt;&lt;END);
   1) Machine Name: $perlvar{'lonHostID'}
   ENTER NEW VALUE:
   END
       my $choice2=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonHostID'}=$choice2;
     }
     elsif ($choice==2) {
     print(&lt;&lt;END);
   2) Domain Name: $perlvar{'lonDefDomain'}
   ENTER NEW VALUE:
   END
       my $choice2=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonDefDomain'}=$choice2;
     }
     elsif ($choice==3) {
     print(&lt;&lt;END);
   3) System Administrator's E-mail Address: $perlvar{'lonAdmEmail'}
   ENTER NEW VALUE:
   END
       my $choice2=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonAdmEmail'}=$choice2;
     }
     elsif ($choice==4) {
     print(&lt;&lt;END);
   4) Role: $perlvar{'lonRole'}
   ENTER NEW VALUE:
   END
       my $choice2=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonRole'}=$choice2;
     }
     elsif ($choice==5) {
     print(&lt;&lt;END);
   5) Cache Expiration Time: $perlvar{'lonExpire'}
   ENTER NEW VALUE:
   END
       my $choice2=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonExpire'}=$choice2;
     }
     elsif ($choice==6) {
     print(&lt;&lt;END);
   6) Server Load: $perlvar{'lonLoadLim'}
   ENTER NEW VALUE:
   END
       my $choice2=&lt;&gt;;
       chomp($choice2);
       $perlvar{'lonLoadLim'}=$choice2;
     }
     elsif ($choice==7) {
       $flag=1;
     }
     else {
   
     }
   }
       open(OUT,"&gt;$confdir$filename") or
         die("Cannot output to $confdir$filename\n");
       foreach my $key (keys %perlvar) {
         my $value=$perlvar{$key};
         print(OUT &lt;&lt;END) unless $perlvarstat{$key};
   PerlSetVar     $key      $value
   END
       }
       close(OUT);
 </perlscript>  </perlscript>
 </file>  </file>
 <file>  <file>
Line 349  on the LON-CAPA network) Line 435  on the LON-CAPA network)
 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) Do not install hosts.tab right now  4) PRESERVE the existing hosts.tab (/home/httpd/lonTabs/hosts.tab)
   
 ENTER 1, 2, 3, or 4:  
 END  END
 # Option number 26 will install rawhide_hosts.tab, but  # Option number 26 will install rawhide_hosts.tab, but
 # the typical user does not want to be part of an intensive  # the typical user does not want to be part of an intensive
Line 359  END Line 444  END
   
 # get input  # get input
 # if valid then process, otherwise loop  # if valid then process, otherwise loop
 my $choice=&lt;&gt;;  my $hostname=`hostname`;chomp($hostname);
 chomp($choice);  my $hostaddress=`hostname -i $hostname`;chomp($hostaddress);
   $flag=0;
   while (!$flag) {
     print "ENTER 1, 2, 3, or 4:\n";
     my $choice=&lt;&gt;;
     chomp($choice);
     if ($choice==1) {
       $lonCluster='production';
       `rm -f ../hosts.tab`;
       `ln -s production_hosts.tab ../hosts.tab`;
       $flag=1;
     }
     elsif ($choice==2) {
       $lonCluster='standalone';
       open(OUT,'&gt;../standalone_hosts.tab') or
         die("cannot open loncom/standalone_hosts.tab for output\n");
       print(OUT &lt;&lt;END);
   $perlvar{'lonHostID'}:$perlvar{'lonDefDomain'}:$perlvar{'lonRole'}:$hostname:$hostaddress
   END
       close(OUT);
       `rm -f ../hosts.tab`;
       `ln -s standalone_hosts.tab ../hosts.tab`;
       $flag=1;
     }
     elsif ($choice==3) {
       $lonCluster='development';
       `rm -f loncom/hosts.tab`;
       `ln -s development_hosts.tab ../hosts.tab`;
       $flag=1;
     }
     elsif ($choice==4) {
       $lonCluster='existing';
       `rm -f ../hosts.tab`;
       `touch existing_hosts.tab`;
       if (-e '/home/httpd/lonTabs/hosts.tab') {
         `cp /home/httpd/lonTabs/hosts.tab ../existing_hosts.tab`;
       }
       `ln -s existing_hosts.tab ../hosts.tab`;
       $flag=1;
     }
     elsif ($choice==26) {
       $lonCluster='rawhide';
       `rm -f ../hosts.tab`;
       `ln -s rawhide_hosts.tab ../hosts.tab`;
       $flag=1;
     }
     else {
   
     }
   }
   
 }  }
 </perlscript>  </perlscript>

Removed from v.1.5  
changed lines
  Added in v.1.7


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