mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* usr/lib/byobu/custom, usr/lib/byobu/disk_io, usr/lib/byobu/ec2_cost,
usr/lib/byobu/network, usr/lib/byobu/reboot_required, usr/lib/byobu/updates_available: - must separate run dirs for tmux/screen run status scripts; otherwise, calculated rates are off
This commit is contained in:
parent
9e60806b02
commit
a033d3d065
7 changed files with 11 additions and 6 deletions
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -53,6 +53,11 @@ byobu (4.30) unreleased; urgency=low
|
|||
rather than a file stat
|
||||
* usr/share/byobu/profiles/tmux:
|
||||
- ensure that byobu-janitor runs on reload
|
||||
* usr/lib/byobu/custom, usr/lib/byobu/disk_io, usr/lib/byobu/ec2_cost,
|
||||
usr/lib/byobu/network, usr/lib/byobu/reboot_required,
|
||||
usr/lib/byobu/updates_available:
|
||||
- must separate run dirs for tmux/screen run status scripts;
|
||||
otherwise, calculated rates are off
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ __custom_detail() {
|
|||
}
|
||||
|
||||
__custom() {
|
||||
local cache="$BYOBU_RUN_DIR/custom"
|
||||
local cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/custom"
|
||||
local i= output=
|
||||
for i in "$BYOBU_CONFIG_DIR/bin/"[0-9]*_*; do
|
||||
# Loop over custom scripts
|
||||
|
|
|
@ -54,7 +54,7 @@ __disk_io() {
|
|||
local disk=${_RET}
|
||||
local t2=`date +%s` t1=
|
||||
for i in "read" "write"; do
|
||||
local cache="$BYOBU_RUN_DIR/disk.$i"
|
||||
local cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/disk.$i"
|
||||
t1=`stat -c %Y "$cache"` 2>/dev/null || t1=0
|
||||
local unit="kB/s"
|
||||
local rate= x1= x2= symbol= unit=
|
||||
|
|
|
@ -39,7 +39,7 @@ __ec2_cost() {
|
|||
. "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}"
|
||||
type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | $SED -e "s/\./_/g")
|
||||
eval rate="\$$type"
|
||||
file_to_stat="$BYOBU_RUN_DIR/ec2_cost.instance_type"
|
||||
file_to_stat="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/ec2_cost.instance_type"
|
||||
[ -f "$file_to_stat" ] || wget -q -O "$file_to_stat" http://169.254.169.254/latest/meta-data/instance-type
|
||||
else
|
||||
. "$BYOBU_PREFIX/share/$PKG/ec2/rates."*
|
||||
|
|
|
@ -39,7 +39,7 @@ __network() {
|
|||
up) symbol="$ICON_UP" ;;
|
||||
down) symbol="$ICON_DN" ;;
|
||||
esac
|
||||
cache="$BYOBU_RUN_DIR/network.$i"
|
||||
cache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/network.$i"
|
||||
[ -r "$cache" ] && read x1 < "$cache" || tx1=0
|
||||
IFS="$OIFS:"
|
||||
while read iface rbytes rpackets rerrs rdrop rfifo rframe rcompressed rmulticast tbytes tpackets terrs tdrop tfifo tcolls tcarrier tcompressed; do
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
REBOOT_FLAG="/var/run/reboot-required"
|
||||
RELOAD_FLAG="$BYOBU_RUN_DIR/reload-required"
|
||||
RELOAD_FLAG="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/reload-required"
|
||||
|
||||
__reboot_required_detail() {
|
||||
[ -e "$REBOOT_FLAG" ] && ls -alF "$REBOOT_FLAG" 2>&1
|
||||
|
|
|
@ -102,7 +102,7 @@ __updates_available_detail() {
|
|||
}
|
||||
|
||||
__updates_available() {
|
||||
local mycache="$BYOBU_RUN_DIR/updates-available"
|
||||
local mycache="$BYOBU_RUN_DIR/cache.$BYOBU_BACKEND/updates-available"
|
||||
# If mycache is present, use it
|
||||
[ -r $mycache ] && ___print_updates `$SED -n '/[^0-9]/s/ .*$//p' $mycache`
|
||||
# If we really need to do so (mycache doesn't exist, or the package database has changed),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue