mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -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
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
[ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue