mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
usr/lib/byobu/network: improve regex of the interface matching, which
was broken for device names >6 chars, LP: #509278
This commit is contained in:
parent
429b419818
commit
3f78ac2cc6
2 changed files with 4 additions and 2 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -3,6 +3,8 @@ byobu (2.56) unreleased; urgency=low
|
||||||
* debian/control: drop byobu-extras empty package
|
* debian/control: drop byobu-extras empty package
|
||||||
* usr/bin/byobu-launcher: fix recent regression, do exec byobu by default,
|
* usr/bin/byobu-launcher: fix recent regression, do exec byobu by default,
|
||||||
but allow for not exec'ing if ~/.byobu/disable-exec exists, LP: #519018
|
but allow for not exec'ing if ~/.byobu/disable-exec exists, LP: #519018
|
||||||
|
* usr/lib/byobu/network: improve regex of the interface matching, which
|
||||||
|
was broken for device names >6 chars, LP: #509278
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 06 Feb 2010 22:10:52 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 06 Feb 2010 22:10:52 -0600
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,10 @@ for i in up down; do
|
||||||
x1=`cat "$cache"` 2>/dev/null || tx1=0
|
x1=`cat "$cache"` 2>/dev/null || tx1=0
|
||||||
if [ "$i" = "up" ]; then
|
if [ "$i" = "up" ]; then
|
||||||
symbol="^"
|
symbol="^"
|
||||||
x2=`grep -m1 "\W$interface:" /proc/net/dev | sed "s/^.*://" | awk '{print $9}'`
|
x2=`grep -m1 "\b$interface:" /proc/net/dev | sed "s/^.*://" | awk '{print $9}'`
|
||||||
else
|
else
|
||||||
symbol="v"
|
symbol="v"
|
||||||
x2=`grep -m1 "\W$interface:" /proc/net/dev | sed "s/^.*://" | awk '{print $1}'`
|
x2=`grep -m1 "\b$interface:" /proc/net/dev | sed "s/^.*://" | awk '{print $1}'`
|
||||||
fi
|
fi
|
||||||
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 }'`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue