Skip to content

Commit

Permalink
[hack] Attempt using ProxyCommand during local mosh-server IP disco…
Browse files Browse the repository at this point in the history
…very

ref: mobile-shell#285
  • Loading branch information
zer0def committed Jun 3, 2024
1 parent 1105d48 commit f426350
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/mosh.pl
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ sub predict_check {
if ( $use_remote_ip eq 'local' ) {
# "parse" the host from what the user gave us
my ($user, $host) = $userhost =~ /^((?:.*@)?)(.*)$/;
my $sshhost = `ssh -G $userhost | awk '/^hostname /{print \$NF}' | tr -d '[:space:]'`;
# get list of addresses
my @res = resolvename( $host, 22, $family );
my @res = resolvename( $sshhost, 22, $family );
# Use only the first address as the Mosh IP
my $hostaddr = $res[0];
if ( !defined $hostaddr ) {
Expand All @@ -347,7 +348,6 @@ sub predict_check {
die( "could not use address for $host" );
}
$ip = $addr_string;
$userhost = "$user$ip";
}

my $pid = open(my $pipe, "-|");
Expand Down

0 comments on commit f426350

Please sign in to comment.