Put disk_list file content to disks array
This commit is contained in:
parent
ddd9191af9
commit
a9d76dd030
|
@ -33,11 +33,13 @@ else {
|
||||||
|
|
||||||
# fallback to disk detection if nothing defined in the config
|
# fallback to disk detection if nothing defined in the config
|
||||||
unless (@disks) {
|
unless (@disks) {
|
||||||
opendir(DIR, '/dev') or die $!;
|
## Put temp_disk_list content to disks array
|
||||||
while (my $dev = readdir(DIR)) {
|
open(my $fh, '<:encoding(UTF-8)', $temp_disk_list)
|
||||||
push(@disks, "/dev/$dev") if ($dev =~ /^[vs]d.*\D$/);
|
or die "Could not open file '$temp_disk_list' $!";
|
||||||
|
while (my $row = <$fh>) {
|
||||||
|
chomp $row;
|
||||||
|
push(@disks, "$row");
|
||||||
}
|
}
|
||||||
closedir(DIR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my @stat = stat($CACHEFILE);
|
my @stat = stat($CACHEFILE);
|
||||||
|
|
Loading…
Reference in New Issue