From 18d5703fd73dbecdccc381ad0a4a29ada7d9c8bd Mon Sep 17 00:00:00 2001 From: Zdenek Behan Date: Sat, 19 Feb 2011 00:36:23 +0100 Subject: [PATCH] scripts: use /sbin/ifconfig where appropriate BUG=n0ne TEST=cros_au_test_harness Change-Id: Ic26cc191fdb995b091d910f1c8a46e37085fea72 Review URL: http://codereview.chromium.org/6538067 --- image_to_live.sh | 2 +- lib/cros_build_lib.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/image_to_live.sh b/image_to_live.sh index 84072398b1..c2aafc3c63 100755 --- a/image_to_live.sh +++ b/image_to_live.sh @@ -107,7 +107,7 @@ function get_hostname { # Dedicated usb NIC? Perhaps this detection should be done in the target, # which will get the return address in one way or another. Or maybe we should # just open a ssh tunnel and use localhost. - hostname=$(sudo ifconfig eth0 | + hostname=$(/sbin/ifconfig eth0 | grep 'inet addr' | cut -f2 -d':' | cut -f1 -d' ') diff --git a/lib/cros_build_lib.py b/lib/cros_build_lib.py index 138bfa7db3..d7da384e09 100644 --- a/lib/cros_build_lib.py +++ b/lib/cros_build_lib.py @@ -256,7 +256,7 @@ def GetIPAddress(device='eth0'): this method gives you a generic way to get the address so you are reachable either via a VM or remote machine on the same network. """ - ifconfig_output = RunCommand(['sudo', 'ifconfig', device], + ifconfig_output = RunCommand(['/sbin/ifconfig', device], redirect_stdout=True, print_cmd=False) match = re.search('.*inet addr:(\d+\.\d+\.\d+\.\d+).*', ifconfig_output) if match: