Diff for /doc/loncapafiles/updatequery.piml between versions 1.26 and 1.27

version 1.26, 2003/05/08 22:17:33 version 1.27, 2003/05/19 18:35:50
Line 57  unless (-l "<TARGET />") { Line 57  unless (-l "<TARGET />") {
   print(&lt;&lt;END);    print(&lt;&lt;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 &lt;&lt;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,'&lt;../'.$lonCluster.'_hosts.tab');         open(IN,'&lt;../'.$lonCluster.'_domain.tab');
        while(&lt;IN&gt;) {         while(&lt;IN&gt;) {
           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,'&lt;/home/httpd/lonTabs/hosts.tab');         open(IN,'&lt;/home/httpd/lonTabs/domain.tab');
        while(&lt;IN&gt;) {         while(&lt;IN&gt;) {
           if (/^$perlvar{'lonHostID'}\:/) {            if (/^$perlvar{'lonDefDomain'}\:/) {
      (undef,undef,undef,undef,undef,$domainDescription)=split(/:/,$_);       (undef,$domainDescription)=split(/:/,$_);
      chomp($domainDescription);       chomp($domainDescription);
              last;               last;
           }            }
Line 624  unless (-l "<TARGET />") { Line 636  unless (-l "<TARGET />") {
   $lineexistflag=0;    $lineexistflag=0;
   $hostidexistflag=0;    $hostidexistflag=0;
   $line2insert=&lt;&lt;END;    $line2insert=&lt;&lt;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,'&gt;../'.$lonCluster.'_hosts.tab') or      open(OUT,'&gt;../'.$lonCluster.'_hosts.tab') or
       die('file generation error');        die('file generation error');
       print(OUT $line2insert);        print(OUT $line2insert);
     close(OUT);      close(OUT);
       open(OUT,'&gt;../'.$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 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,'&lt;../'.$lonCluster.'_domain.tab');
       while(&lt;IN&gt;) {
         if (/^$domaininsert$/) {
           $lineexistflag=1;
         }
         if (/^$perlvar{'lonDefDomain'}\:/) {
           $domainexistflag=1;
         }
       }
       close(IN);
       if ($domainexistflag and !$lineexistflag) {
         print &lt;&lt;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 &gt; ../new_${lonCluster}_domain.tab`;
          open(OUT,'&gt;&gt;../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 www.lon-capa.org > /dev/null || ping -c 1 www.msu.edu > /dev/null || ping -c 1 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 &lt;&lt;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 &lt;&lt;END;
   New entry for $lonCluster.
   END
         `cat ../${lonCluster}_domain.tab &gt; ../new_${lonCluster}_domain.tab`;
          open(OUT,'&gt;&gt;../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>

Removed from v.1.26  
changed lines
  Added in v.1.27


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