mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
must compute unit inside of loop
Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
be0712e105
commit
26cf4fc69d
1 changed files with 1 additions and 1 deletions
|
@ -31,12 +31,12 @@ if [ "$1" = "--detail" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unit="kB/s"
|
|
||||||
t2=`date +%s`
|
t2=`date +%s`
|
||||||
ifconfig=`/sbin/ifconfig "$interface" | grep "RX bytes" | sed "s/.*:\(.*\) (.*:\(.*\) (.*/\1\n\2/"`
|
ifconfig=`/sbin/ifconfig "$interface" | grep "RX bytes" | sed "s/.*:\(.*\) (.*:\(.*\) (.*/\1\n\2/"`
|
||||||
for i in up down; do
|
for i in up down; do
|
||||||
cache="/var/run/screen/S-$USER/$PKG.network_$i"
|
cache="/var/run/screen/S-$USER/$PKG.network_$i"
|
||||||
t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0
|
t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0
|
||||||
|
unit="kB/s"
|
||||||
if [ $t2 -le $t1 ]; then
|
if [ $t2 -le $t1 ]; then
|
||||||
rate=0
|
rate=0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue