|
|
@ -7,13 +7,13 @@ my @blocks = grep { $_ !~ m/^\./ } readdir($dh); |
|
|
|
closedir($dh); |
|
|
|
closedir($dh); |
|
|
|
my $json; |
|
|
|
my $json; |
|
|
|
foreach my $block (@blocks){ |
|
|
|
foreach my $block (@blocks){ |
|
|
|
my $remouvable = 0; |
|
|
|
my $removable = 0; |
|
|
|
if ( -e "/sys/block/$block/remouvable"){ |
|
|
|
if ( -e "/sys/block/$block/removable"){ |
|
|
|
open REMOUVABLE, "/sys/block/$block/remouvable"; |
|
|
|
open REMOVABLE, "/sys/block/$block/removable"; |
|
|
|
$remouvable = join "", <REMOUVABLE>; |
|
|
|
$removable = join "", <REMOVABLE>; |
|
|
|
close REMOUVABLE; |
|
|
|
close REMOVABLE; |
|
|
|
chomp($remouvable); |
|
|
|
chomp($removable); |
|
|
|
next if ($remouvable eq '1'); |
|
|
|
next if ($removable eq '1'); |
|
|
|
} |
|
|
|
} |
|
|
|
my $dev = '/dev/' . $block; |
|
|
|
my $dev = '/dev/' . $block; |
|
|
|
push @{$json->{data}}, { "{#BLOCKDEVICE}" => $dev }; |
|
|
|
push @{$json->{data}}, { "{#BLOCKDEVICE}" => $dev }; |
|
|
|