Changeset 479a7d9


Ignore:
Timestamp:
May 25, 2010 5:41:26 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
d38ff56
Parents:
85462fb
Message:

Confirm that remote redirection reaches nodes (an lets this script find them
rather than making fedd do it). Also make sure there are no dupes in the ports
to forward.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/port_forward.pl

    r85462fb r479a7d9  
    4444exit(20) if $?;
    4545
     46# Remove dupes from ports
     47my %mark;
     48@ports = grep($mark{$_}++, @ports);
     49
    4650foreach my $p (@ports) {
    4751    my ($type, $port, $host, $eport) = split(":", $p);
    4852    $eport = $port unless $eport;
     53    if ($type ne "local") {
     54        # We will need to resolve this host name.  Make sure we can.
     55        if (!gateway_lib::get_ip($host)) {
     56            # the short form isn't resovable. Try the full domain that the
     57            # portal is in.  If that doesn't work assume the user knows better
     58            # and leave $host untouched.
     59            chomp (my $hn = `hostname`);
     60            (my $try = $hn) =~ s/^[^\.]+/$host/;
     61
     62            $host = $try if gateway_lib::get_ip($try);
     63        }
     64    }
    4965    my $fopt =  ($type eq 'local'  ? "-L" : "-R") . " :$port:$host:$eport";
    5066    my $cmd = "$ssh -N $fopt -p $ssh_port -o \"StrictHostKeyChecking no\" " .
Note: See TracChangeset for help on using the changeset viewer.