Skip to content

Commit

Permalink
Update NetworkUtils.java (openhab#4900)
Browse files Browse the repository at this point in the history
Removed "(\s*)" from RegExp expression as "\s" not present in the current tool help output and it will fail RegExp, current tool output looks like this (as of version 2.19):

-w sec Specify a timeout before ping exits regardless of how many
packets have been sent or received.

Signed-off-by: Konstantin Panchenko <[email protected]>
Signed-off-by: Pshatsillo <[email protected]>
  • Loading branch information
kpanchen authored and Pshatsillo committed Jun 19, 2019
1 parent 00f2a3d commit 487d965
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public ArpPingUtilEnum determineNativeARPpingMethod(String arpToolPath) {
if (StringUtils.isBlank(result)) {
return ArpPingUtilEnum.UNKNOWN_TOOL;
} else if (result.contains("Thomas Habets")) {
if (result.matches("(?s)(.*)w sec(\\s*)Specify a timeout(.*)")) {
if (result.matches("(?s)(.*)w sec Specify a timeout(.*)")) {
return ArpPingUtilEnum.THOMAS_HABERT_ARPING;
} else {
return ArpPingUtilEnum.THOMAS_HABERT_ARPING_WITHOUT_TIMEOUT;
Expand Down

0 comments on commit 487d965

Please sign in to comment.