Skip to content

Commit cc63f0f

Browse files
committed
fix: specifically look if it's the local port that's already in use
1 parent e41dc70 commit cc63f0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Tool/Ssh.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public static function tunnelBastionHost(array $bastionHost, int $localPort, str
4949
return;
5050
}
5151

52-
if (false !== stripos($buffer, 'address already in use')) {
53-
throw new RuntimeException(sprintf('Unable to create SSH tunnel. Port "%s" is already in use.', $localPort));
52+
if (false !== stripos($buffer, sprintf('%s: address already in use', $localPort))) {
53+
throw new RuntimeException(sprintf('Unable to create SSH tunnel. Local port "%s" is already in use.', $localPort));
5454
}
5555
});
5656

0 commit comments

Comments
 (0)