Commit ff51fd71 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

do not report sd[a-z] if there are sd[a-z][1-9]

parent 7b745b4b
......@@ -678,6 +678,8 @@ function get_partitions()
function get_mnt_dev()
{
$partitions = get_partitions();
$devices = array();
$fs_types = array();
foreach ($partitions as $partition => $size) {
$res = array();
$dev = "/dev/" . $partition;
......@@ -708,6 +710,8 @@ function get_raw_dev()
// filter out partitions with file system
$i = 0;
$raw_devices = array();
print_r($names);
print_r($devices);
foreach ($names as $name => $size) {
$found = false;
foreach ($devices as $device) {
......@@ -721,6 +725,17 @@ function get_raw_dev()
}
}
//special case
if (count($raw_devices)>1) {
foreach($raw_devices as $k=>$v){
if (preg_match('/sd[a-z][0-9]/',$k)==0) {
unset($raw_devices[$k]);
}
}
}
print_r($raw_devices);
return $raw_devices;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment