mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
usr/lib/byobu/disk_io: improve MONITORED_DISK overriding
This commit is contained in:
parent
65d9d8b4f1
commit
0536f042d2
2 changed files with 9 additions and 7 deletions
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -9,6 +9,7 @@ byobu (2.72) UNRELEASED; urgency=low
|
||||||
share/man/man1/byobu.1: added a disk throughput notification
|
share/man/man1/byobu.1: added a disk throughput notification
|
||||||
* usr/bin/byobu-janitor: add hyphenation to the regex to allow for
|
* usr/bin/byobu-janitor: add hyphenation to the regex to allow for
|
||||||
disk_io
|
disk_io
|
||||||
|
* usr/lib/byobu/disk_io: improve MONITORED_DISK overriding
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 22 Apr 2010 12:31:20 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 22 Apr 2010 12:31:20 -0500
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,16 @@
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
color 2>/dev/null || color() { true; }
|
color 2>/dev/null || color() { true; }
|
||||||
|
|
||||||
# Allow interface overrides in $HOME/.$PKG/status
|
# Default to disk providing /, but let users override with MONITORED_DISK
|
||||||
if [ -n "$MONITORED_DISK" ]; then
|
[ -z "$MONITORED_DISK" ] && MP="/" || MP="$MONITORED_DISK"
|
||||||
disk="$MONITORED_DISK"
|
case $MP in
|
||||||
else
|
/dev/*) disk="$MP" ;;
|
||||||
disk=$(df -h / | tail -n1 | sed -e "s/[0-9].*$//" -e "s:^.*/::")
|
*) disk=$(grep -m 1 " $MP " /etc/mtab | sed -e "s: .*$::") ;;
|
||||||
fi
|
esac
|
||||||
|
disk=$(echo "$disk" | sed -e "s: .*$::" -e "s:^.*/::" -e "s:[0-9]*$::")
|
||||||
|
|
||||||
if [ "$1" = "--detail" ]; then
|
if [ "$1" = "--detail" ]; then
|
||||||
if [ -x /usr/bin/iostat ]; then
|
if which iostat >/dev/null; then
|
||||||
iostat -d -m -h
|
iostat -d -m -h
|
||||||
else
|
else
|
||||||
echo "Please install iostat if you want detailed information on your disk throughput"
|
echo "Please install iostat if you want detailed information on your disk throughput"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue