blink: Blink RAID device md? blinks all the devices in the RAID.
This commit is contained in:
parent
453802d183
commit
c1d8d958d2
15
blink/blink
15
blink/blink
|
@ -163,11 +163,24 @@ GetOptions(
|
|||
"s|all-slots|allslots" => \$::opt_allslots,
|
||||
);
|
||||
|
||||
my @more_args = ();
|
||||
if(@ARGV) {
|
||||
for(@ARGV) {
|
||||
s:/dev/::g;
|
||||
s{/dev/}{}g;
|
||||
if(/^md/) {
|
||||
# RAID device. Try to find the matching physical devices
|
||||
my $md = $_;
|
||||
for my $line (grep /^$md :/, `cat /proc/mdstat`) {
|
||||
# md1 : active raid6 sdat[14](S) sdx[13] sds[12](S) sdc[6](S) sdb[0] sdm[9] sdk[7] sdaa[10] sdi[5] sdh[4]
|
||||
while($line =~ s/(\S+)\[//) {
|
||||
push @more_args, $1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
push @ARGV,@more_args;
|
||||
|
||||
|
||||
if(not ($::opt_on or $::opt_off or $::opt_toggle or
|
||||
$::opt_alldetected or $::opt_allslots or @ARGV)) {
|
||||
|
|
Loading…
Reference in a new issue