From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Lively Subject: [PATCH] minor tweak to keep network-bridge working in busybox environment Date: Fri, 19 May 2006 14:02:54 -0400 Message-ID: <446E084E.9010603@virtualiron.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000005020102090507070802" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000005020102090507070802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Folks - The latest tweak to the network-bridge script doesn't work in a busybox environment (because the busybox version of 'awk' is a little too feeble). The attached patch fixes this, while keeping it working in a more capable environment. (It also generalizes the vifnum extraction slightly - stripping all leading non-numeric chars from the default ifname.) Dave --------------000005020102090507070802 Content-Type: text/x-patch; name="network-bridge-tweak.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="network-bridge-tweak.patch" Make the latest network-bridge tweaks work in a busybox environment too. Signed-off-by: David Lively diff -r aa17b7173325 tools/examples/network-bridge --- a/tools/examples/network-bridge Thu May 18 21:41:56 2006 +0100 +++ b/tools/examples/network-bridge Fri May 19 14:00:34 2006 -0400 @@ -59,7 +59,7 @@ findCommand "$@" findCommand "$@" evalVariables "$@" -vifnum=${vifnum:-$(ip route list | awk '/^default / { sub(/^(eth|xenbr)/,"",$NF); print $NF }')} +vifnum=${vifnum:-$(ip route list | awk '/^default / { print $NF }' | sed -r 's/[^0-9]+//')} bridge=${bridge:-xenbr${vifnum}} netdev=${netdev:-eth${vifnum}} antispoof=${antispoof:-no} --------------000005020102090507070802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000005020102090507070802--