diff --git a/lib/perl/OVH/Bastion.pm b/lib/perl/OVH/Bastion.pm index 7e40e98..7554e9f 100644 --- a/lib/perl/OVH/Bastion.pm +++ b/lib/perl/OVH/Bastion.pm @@ -817,6 +817,7 @@ sub machine_display { my $proxyPort = $params{'proxyPort'}; my $proxyUser = $params{'proxyUser'}; my $remotePort = $params{'remotePort'}; + my $localPort = $params{'localPort'}; my $machine = (index($ip, ':') >= 0 ? "[$ip]" : $ip); $machine .= ":$port" if $port; @@ -829,8 +830,10 @@ sub machine_display { $machine = "$machine via $proxy"; } - if ($remotePort) { - $machine .= " (remote port forwarding: $remotePort)"; + if ($remotePort && !$localPort) { + $machine .= " (port forwarding: $remotePort)"; + } elsif ($localPort) { + $machine .= " (port forwarding: $localPort->$remotePort)"; } return R('OK', value => $machine);