mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
usr/lib/ec2_cost, usr/lib/rcs_cost
This commit is contained in:
parent
bee7ef6af4
commit
31f0d49667
3 changed files with 9 additions and 4 deletions
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -3,6 +3,7 @@ byobu (2.81) unreleased; urgency=low
|
|||
* Save some forks:
|
||||
- usr/bin/byobu-status
|
||||
- usr/lib/byobu/custom
|
||||
- usr/lib/ec2_cost, usr/lib/rcs_cost
|
||||
- usr/lib/byobu/ip_address
|
||||
- usr/lib/byobu/release
|
||||
- usr/lib/services
|
||||
|
|
|
@ -66,8 +66,10 @@ IF=`tail -n1 /proc/net/route | awk '{print $1}'`
|
|||
ifconfig_out=`LC_ALL=C /sbin/ifconfig "$IF"`
|
||||
|
||||
# Calculate bandwidth cost
|
||||
tx_gb=`echo "$ifconfig_out" | grep "TX bytes:" | sed "s/^.*TX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'`
|
||||
rx_gb=`echo "$ifconfig_out" | grep "RX bytes:" | sed "s/^.*RX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'`
|
||||
tx_gb=${ifconfig_out#*RX bytes:}
|
||||
tx_gb=$(echo ${tx_gb%% *} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }')
|
||||
rx_gb=${ifconfig_out#*TX bytes:}
|
||||
rx_gb=$(echo ${rx_gb%% *} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }')
|
||||
network_cost=`echo "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f", $1*$2, $3*$4}' | awk '{printf "%f", $1 + $2}'`
|
||||
|
||||
# Calculate uptime cost
|
||||
|
|
|
@ -69,8 +69,10 @@ IF=`tail -n1 /proc/net/route | awk '{print $1}'`
|
|||
ifconfig_out=`LC_ALL=C /sbin/ifconfig "$IF"`
|
||||
|
||||
# Calculate bandwidth cost
|
||||
tx_gb=`echo "$ifconfig_out" | grep "TX bytes:" | sed "s/^.*TX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'`
|
||||
rx_gb=`echo "$ifconfig_out" | grep "RX bytes:" | sed "s/^.*RX bytes://" | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }'`
|
||||
tx_gb=${ifconfig_out#*RX bytes:}
|
||||
tx_gb=$(echo ${tx_gb%% *} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }')
|
||||
rx_gb=${ifconfig_out#*TX bytes:}
|
||||
rx_gb=$(echo ${rx_gb%% *} | awk '{ printf "%f", $1 / 1024 / 1024 / 1024 }')
|
||||
network_cost=`echo "$tx_gb" "$TX_RATE" "$rx_gb" "$RX_RATE" | awk '{printf "%f %f", $1*$2, $3*$4}' | awk '{printf "%f", $1 + $2}'`
|
||||
|
||||
# Calculate uptime cost
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue