diff --git a/blink/blink b/blink/blink index e3c7150..ec69577 100755 --- a/blink/blink +++ b/blink/blink @@ -14,12 +14,16 @@ B I I =head1 DESCRIPTION -B blinks a device in an external harddisk enclosure. +B blinks a device in a harddisk enclosure. If no I is given the blinking be will toggled. -If no I is given all detected disks in external enclosures will -be used. +If no I is given all detected disks in enclosures will be +used. + +If no I and no I is given all detected harddisks will +be off and all empty slots or slots with non-detected harddisks in +enclosures will blink. These slots should be safe to remove. =head1 OPTIONS @@ -92,13 +96,18 @@ B =head1 EXAMPLE: Blink all undetected slots -To blink all undetected slots we first blink all detected and then toggle all slots: - -B - It will be safe to remove disk from all the blinking slots as the slots are either empty or not detected. +B + + +=head1 EXAMPLE: Turn off blinking of all slots + +Turn off the blinking. + +B + =head1 EXIT STATUS @@ -160,6 +169,18 @@ if(@ARGV) { } } +if(not ($::opt_on or $::opt_off or $::opt_toggle or + $::opt_alldetected or $::opt_allslots or @ARGV)) { + # Default: + # Turn on all + # Turn off all-detected + $locate = "/sys/class/enclosure/*/*/locate"; + on($locate); + $locate = "/sys/class/enclosure/*/*/device/enclosure*/locate"; + off($locate); + exit; +} + if($::opt_alldetected) { $locate = "/sys/class/enclosure/*/*/device/enclosure*/locate"; } elsif($::opt_allslots) {