* bin/ec2-cost: since route -n is being used, must grep for 0.0.0.0,

Bug #336955
This commit is contained in:
Dustin Kirkland 2009-03-02 16:38:43 -06:00
commit d749b60c38
2 changed files with 6 additions and 5 deletions

View file

@ -57,8 +57,8 @@ CPU_RATE=`echo "$cpu_count" | awk '{printf "%f", 0.10*$1}'`
RX_RATE="0.10" RX_RATE="0.10"
TX_RATE="0.17" TX_RATE="0.17"
# Perhaps should auto detect this? # Auto detect network interface
IF=`route -n | grep "^default" | awk '{print $8}'` IF=`route -n | grep "^0\.0\.0\.0" | tail -n1 | awk '{print $8}'`
# Calculate bandwidth cost # Calculate bandwidth cost
tx_gb=`/sbin/ifconfig "$IF" | grep "TX bytes:" | sed "s/^.*TX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'` tx_gb=`/sbin/ifconfig "$IF" | grep "TX bytes:" | sed "s/^.*TX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'`

7
debian/changelog vendored
View file

@ -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 <kirkland@ubuntu.com> Sun, 01 Mar 2009 12:53:31 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Mon, 02 Mar 2009 16:28:57 -0600
screen-profiles (1.31-0ubuntu1) jaunty; urgency=low screen-profiles (1.31-0ubuntu1) jaunty; urgency=low