Put disk_list file content to disks array

This commit is contained in:
Jeremy Gardais 2020-02-28 13:58:33 +01:00
parent ddd9191af9
commit a9d76dd030
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 6 additions and 4 deletions

View File

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