diff --git a/usr/lib/byobu/raid b/usr/lib/byobu/raid index 3c0f5e04..3782f7e0 100755 --- a/usr/lib/byobu/raid +++ b/usr/lib/byobu/raid @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +[ -r /proc/mdstat ] || exit 0 + PKG="byobu" color 2>/dev/null || color() { true; } @@ -33,11 +35,11 @@ if grep -qs " blocks \[.*_.*\]$" /proc/mdstat; then fi if grep -qs \% /proc/mdstat; then - p=$(grep \% /proc/mdstat | sed -e "s/\%.*//" -e "s/.* //") - sync=",$p%" + p=$(grep \% /proc/mdstat | sed -e "s/\%.*/%/" -e "s/.* //") + [ -z "$msg" ] && msg="RAID" + msg="$msg,$p" fi if [ -n "$msg" ]; then - printf "$(color B w r)%s%s$(color -) " "$msg" "$sync" + printf "$(color B w r)%s$(color -) " "$msg" fi -