Show
Ignore:
Timestamp:
02/28/10 11:28:41 (2 years ago)
Author:
Ted Faber <faber@…>
Children:
358e0b814584cf8ef3d84cd4ed922cb20fcb2f69
Parents:
f0174470b1d2142cc5c69a36ab0d2b1364f17518
git-committer:
Ted Faber <faber@isi.edu> / 2010-02-28T19:28:41Z+0000
Message:

Missed a newline

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • fedkit/federate.pl

    rdbc9144 rcc0ffd2  
    77use IO::Pipe; 
    88use File::Copy; 
     9 
     10use Net::hostent; 
     11use Socket; 
    912 
    1013use gateway_lib; 
     
    2427my $smbuser; 
    2528my $smbproject; 
     29my $exp; 
     30my $proj; 
    2631chomp (my $uname = `uname`); 
    2732my $smbmount = "smbmount.$uname.pl"; 
     
    4045while (<$tmcc_p>) { 
    4146    /ALLOCATED=([^\/]+)\/(\S+)/ && do { 
    42         $shared_config_dir = "/proj/$1/exp/$2/tmp"; 
     47        ($proj, $exp) = ($1, $2); 
     48        $shared_config_dir = "/proj/$proj/exp/$exp/tmp"; 
    4349        last; 
    4450    }; 
     
    6874my $config_hosts = new IO::File("$shared_config_dir/hosts") ||  
    6975    die "Can't open $shared_config_dir/hosts: $!\n"; 
     76my $has_control = 0; 
    7077 
    7178while (<$hosts>) { 
    7279    /^127\.0\.0\.1/ && do { print $new_hosts $_; }; 
     80    /control\./ && $has_control++; 
    7381} 
    7482$hosts->close(); 
     
    7785} 
    7886$config_hosts->close(); 
     87 
     88# If seer is enabled and no local control node in play, alias the gateway to be 
     89# control 
     90if ($services{'seer'} && !$has_control ) { 
     91    if ( my $hent = gethostbyname($gateway) ) { 
     92        my $gwip = inet_ntoa($hent->addr_list->[0]); 
     93 
     94        print $new_hosts "\n$gwip\tcontrol.$exp.$proj\n"; 
     95    } 
     96} 
    7997$new_hosts->close(); 
    8098copy("/tmp/hosts", "/etc/hosts");