You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
389 B
Bash
18 lines
389 B
Bash
#!/bin/bash
|
|
|
|
DEVICE="/dev/md0"
|
|
|
|
TOTAL_DEVICES=$(mdadm -D "$DEVICE" | grep 'Total Devices' | cut -d':' -f 2 | tr -d ' ')
|
|
|
|
mdadm -D "$DEVICE" | tail -n "$TOTAL_DEVICES" | tr -s ' ' | cut -d' ' -f 6
|
|
|
|
# Example Output:
|
|
#
|
|
# active
|
|
# active
|
|
# active
|
|
# active
|
|
# active
|
|
#
|
|
|
|
# TODO: Non ho realmente trovato nella documentazione le altre parole, penso siano "missing" e "failing" però boh |