From d749b60c3821d48068b2fb6150e7674237147a0f Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 2 Mar 2009 16:38:43 -0600 Subject: [PATCH] * bin/ec2-cost: since route -n is being used, must grep for 0.0.0.0, Bug #336955 --- bin/ec2-cost | 4 ++-- debian/changelog | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/ec2-cost b/bin/ec2-cost index bcaa9bfc..c4b56cd1 100755 --- a/bin/ec2-cost +++ b/bin/ec2-cost @@ -57,8 +57,8 @@ CPU_RATE=`echo "$cpu_count" | awk '{printf "%f", 0.10*$1}'` RX_RATE="0.10" TX_RATE="0.17" -# Perhaps should auto detect this? -IF=`route -n | grep "^default" | awk '{print $8}'` +# Auto detect network interface +IF=`route -n | grep "^0\.0\.0\.0" | tail -n1 | awk '{print $8}'` # Calculate bandwidth cost tx_gb=`/sbin/ifconfig "$IF" | grep "TX bytes:" | sed "s/^.*TX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'` diff --git a/debian/changelog b/debian/changelog index ad645273..40106fa7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -screen-profiles (1.32) unreleased; urgency=low +screen-profiles (1.32-0ubuntu1) jaunty; urgency=low - * + * bin/ec2-cost: since route -n is being used, must grep for 0.0.0.0, + LP: #336955 - -- Dustin Kirkland Sun, 01 Mar 2009 12:53:31 -0600 + -- Dustin Kirkland Mon, 02 Mar 2009 16:28:57 -0600 screen-profiles (1.31-0ubuntu1) jaunty; urgency=low