Don't capture stderr, this will return an error when the runscript command expects null when there is no default route.

This commit is contained in:
Hugo Trippaers 2013-10-14 09:58:37 +02:00
parent 71dc43ebb0
commit 795366019b

View File

@ -199,7 +199,7 @@ public class NetUtils {
public static String getDefaultEthDevice() {
if (SystemUtils.IS_OS_MAC) {
String defDev = Script.runSimpleBashScript("/sbin/route -n get default | grep interface | awk '{print $2}'");
String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'");
return defDev;
}
String defaultRoute = Script.runSimpleBashScript("/sbin/route | grep default");