X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/42856e8b3cb0b621218f11d7828a51d03d77ae33..3baec6c054ef4463018a9bac53e21cf9fc5effe3:/src/Utils.php diff --git a/src/Utils.php b/src/Utils.php index 527d0f3..f00b6d1 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -45,9 +45,17 @@ class OMVModuleZFSUtil { foreach($out as $name) { $pooluuid = OMVModuleZFSUtil::getUUIDbyName($name); if (isset($pooluuid)) { - $xpath = "//system/fstab/mntent[fsname=" . $pooluuid . "]"; + $pooluuid = "UUID=" . $pooluuid; + $xpath = "//system/fstab/mntent"; $object = $xmlConfig->get($xpath); - if(is_null($object)) { + $uuidexists = false; + foreach ($object as $obj) { + if (strcmp($pooluuid, $obj['fsname']) === 0) { + $uuidexists = true; + break; + } + } + if (!$uuidexists) { $uuid = OMVUtil::uuid(); $ds = new OMVModuleZFSDataset($name); $dir = $ds->getMountPoint(); @@ -136,7 +144,7 @@ class OMVModuleZFSUtil { 'parentid'=>$prefix . $root . "/" . $result[1], 'name'=>$result[2], 'type'=>ucfirst($type), - 'icon'=>"images/zfs_disk.png", + 'icon'=>"images/save.png", 'path'=>$path, 'expanded'=>$expanded); array_push($objects,$tmp);