mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-23 06:36:17 -07:00
usr/lib/byobu/network: ensure that up/down and units are always set
This commit is contained in:
parent
30698f6899
commit
b05d8b006e
2 changed files with 6 additions and 3 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -1,6 +1,6 @@
|
|||
byobu (3.19) unreleased; urgency=low
|
||||
|
||||
* UNRELEASED
|
||||
* usr/lib/byobu/network: ensure that up/down and units are always set
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 27 Dec 2010 23:44:05 -0600
|
||||
|
||||
|
|
|
@ -36,6 +36,11 @@ fi
|
|||
[ -d "/var/run/screen/S-$USER" ] && DIR="/var/run/screen/S-$USER" || DIR="$DATA"
|
||||
t2=`date +%s`
|
||||
for i in up down; do
|
||||
unit="kbps"
|
||||
case $i in
|
||||
up) symbol="^" ;;
|
||||
down) symbol="v" ;;
|
||||
esac
|
||||
cache="$DIR/$PKG.network_$i"
|
||||
t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0
|
||||
if [ $t2 -le $t1 ]; then
|
||||
|
@ -43,10 +48,8 @@ for i in up down; do
|
|||
else
|
||||
x1=`cat "$cache"` 2>/dev/null || tx1=0
|
||||
if [ "$i" = "up" ]; then
|
||||
symbol="^"
|
||||
x2=`grep -m1 "\b$interface:" /proc/net/dev | sed "s/^.*://" | awk '{print $9}'`
|
||||
else
|
||||
symbol="v"
|
||||
x2=`grep -m1 "\b$interface:" /proc/net/dev | sed "s/^.*://" | awk '{print $1}'`
|
||||
fi
|
||||
echo "$x2" > "$cache"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue