Skip to content

Commit

Permalink
Read from both /proc/net/tcp and /proc/net/tcp6 in `InternalComma…
Browse files Browse the repository at this point in the history
…ndPortListeningCheck` (#750)
  • Loading branch information
bsideup committed Jun 13, 2018
1 parent 8402356 commit cf72d08
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Boolean call() {

private void tryPort(Integer internalPort) {
String[][] commands = {
{"/bin/sh", "-c", format("cat /proc/net/tcp | awk '{print $2}' | grep -i :%x && echo %s", internalPort, SUCCESS_MARKER)},
{"/bin/sh", "-c", format("cat /proc/net/tcp{,6} | awk '{print $2}' | grep -i :%x && echo %s", internalPort, SUCCESS_MARKER)},
{"/bin/sh", "-c", format("nc -vz -w 1 localhost %d && echo %s", internalPort, SUCCESS_MARKER)},
{"/bin/bash", "-c", format("</dev/tcp/localhost/%d && echo %s", internalPort, SUCCESS_MARKER)}
};
Expand Down

0 comments on commit cf72d08

Please sign in to comment.