mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-23 06:36:17 -07:00
fix raid; make sure mdstat is on this system first, fix printing
This commit is contained in:
parent
1524b035f4
commit
22a6d1912e
1 changed files with 6 additions and 4 deletions
|
@ -17,6 +17,8 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
[ -r /proc/mdstat ] || exit 0
|
||||||
|
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
color 2>/dev/null || color() { true; }
|
color 2>/dev/null || color() { true; }
|
||||||
|
|
||||||
|
@ -33,11 +35,11 @@ if grep -qs " blocks \[.*_.*\]$" /proc/mdstat; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -qs \% /proc/mdstat; then
|
if grep -qs \% /proc/mdstat; then
|
||||||
p=$(grep \% /proc/mdstat | sed -e "s/\%.*//" -e "s/.* //")
|
p=$(grep \% /proc/mdstat | sed -e "s/\%.*/%/" -e "s/.* //")
|
||||||
sync=",$p%"
|
[ -z "$msg" ] && msg="RAID"
|
||||||
|
msg="$msg,$p"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$msg" ]; then
|
if [ -n "$msg" ]; then
|
||||||
printf "$(color B w r)%s%s$(color -) " "$msg" "$sync"
|
printf "$(color B w r)%s$(color -) " "$msg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue