* usr/lib/byobu/raid: LP: #1006971

- ensure raid status cache gets cleared out when done rebuilding
This commit is contained in:
Dustin Kirkland 2012-06-24 13:39:41 -05:00
commit f6efb9eb0c
2 changed files with 12 additions and 4 deletions

2
debian/changelog vendored
View file

@ -10,6 +10,8 @@ byobu (5.20) unreleased; urgency=low
- drop run-one usage, use flock directly instead
* debian/control, usr/share/byobu/windows/common:
- fix some lintian warnings and errors
* usr/lib/byobu/raid: LP: #1006971
- ensure raid status cache gets cleared out when done rebuilding
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 08 Jun 2012 17:25:23 -0500

View file

@ -29,15 +29,21 @@ __raid() {
# Errors in your raid
case "$line" in
*\ blocks\ *\[*_*\]$)
[ -z "${msg}" ] && msg="RAID";;
[ -z "${msg}" ] && msg="RAID"
;;
*%*)
p="${line%%\%*}${PCT}"; p=${p##* };
[ -z "$msg" ] && msg="RAID"
msg="$msg,$p";;
msg="$msg,$p"
;;
esac
done < /proc/mdstat
[ -n "$msg" ] || return
color B w r; printf "%s" "$msg"; color --
if [ -n "$msg" ]; then
color B w r; printf "%s" "$msg"; color --
elif [ -e "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/raid" ]; then
# Clear out cached raid message
rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/raid"*
fi
}
# vi: syntax=sh ts=4 noexpandtab