mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* bin/network-*: set rate=0 when rate is negative (ie, on startup)
Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
d998b0e16d
commit
4a44d0b211
3 changed files with 8 additions and 3 deletions
|
@ -38,7 +38,9 @@ else
|
||||||
x2=`/sbin/ifconfig "$interface" | grep "RX bytes" | sed "s/^.*RX bytes://" | sed "s/ .*$//"`
|
x2=`/sbin/ifconfig "$interface" | grep "RX bytes" | sed "s/^.*RX bytes://" | sed "s/ .*$//"`
|
||||||
echo "$x2" > "$cache"
|
echo "$x2" > "$cache"
|
||||||
rate=`echo "$t1" "$t2" "$x1" "$x2" | awk '{printf "%.0f", ($4 - $3) / ($2 - $1) / 1024 }'`
|
rate=`echo "$t1" "$t2" "$x1" "$x2" | awk '{printf "%.0f", ($4 - $3) / ($2 - $1) / 1024 }'`
|
||||||
if [ "$rate" -gt 1024 ]; then
|
if [ "$rate" -lt 0 ]; then
|
||||||
|
rate=0
|
||||||
|
elif [ "$rate" -gt 1024 ]; then
|
||||||
rate=`echo "$rate" | awk '{printf "%.1f", $1/1024}'`
|
rate=`echo "$rate" | awk '{printf "%.1f", $1/1024}'`
|
||||||
unit="MB/s"
|
unit="MB/s"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -39,7 +39,9 @@ else
|
||||||
x2=`/sbin/ifconfig "$interface" | grep "TX bytes" | sed "s/^.*TX bytes://" | sed "s/ .*$//"`
|
x2=`/sbin/ifconfig "$interface" | grep "TX bytes" | sed "s/^.*TX bytes://" | sed "s/ .*$//"`
|
||||||
echo "$x2" > "$cache"
|
echo "$x2" > "$cache"
|
||||||
rate=`echo "$t1" "$t2" "$x1" "$x2" | awk '{printf "%.0f", ($4 - $3) / ($2 - $1) / 1024 }'`
|
rate=`echo "$t1" "$t2" "$x1" "$x2" | awk '{printf "%.0f", ($4 - $3) / ($2 - $1) / 1024 }'`
|
||||||
if [ "$rate" -gt 1024 ]; then
|
if [ "$rate" -lt 0 ]; then
|
||||||
|
rate=0
|
||||||
|
elif [ "$rate" -gt 1024 ]; then
|
||||||
rate=`echo "$rate" | awk '{printf "%.1f", $1/1024}'`
|
rate=`echo "$rate" | awk '{printf "%.1f", $1/1024}'`
|
||||||
unit="MB/s"
|
unit="MB/s"
|
||||||
fi
|
fi
|
||||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -4,8 +4,9 @@ byobu (2.6) unreleased; urgency=low
|
||||||
remove the dpkg diversion on /usr/bin/screen as this has proven
|
remove the dpkg diversion on /usr/bin/screen as this has proven
|
||||||
to be controversial; users will need to call "byobu" to launch
|
to be controversial; users will need to call "byobu" to launch
|
||||||
a byobu-style screen session
|
a byobu-style screen session
|
||||||
|
* bin/network-*: set rate=0 when rate is negative (ie, on startup)
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 26 May 2009 16:47:40 +0200
|
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 26 May 2009 21:52:53 +0200
|
||||||
|
|
||||||
byobu (2.5-0ubuntu1) karmic; urgency=low
|
byobu (2.5-0ubuntu1) karmic; urgency=low
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue