]> git.datanom.net - omvzfs.git/commitdiff
Added mount and unmount methods to the Dataset class
authorNiclas Berglind <nb@kjam.se>
Tue, 4 Mar 2014 21:00:10 +0000 (22:00 +0100)
committerMichael Rasmussen <mir@datanom.net>
Tue, 4 Mar 2014 21:53:01 +0000 (22:53 +0100)
Signed-off-by: Niclas Berglind <nb@kjam.se>
src/Dataset.php

index d6796e59217a55127df9d9aa6fa69095219b2f0b..57e8eddb5e2c77a1d3bf2044ca137fbcf75f3c23 100644 (file)
@@ -191,6 +191,31 @@ class OMVModuleZFSDataset {
                $this->exec($cmd,$out,$res);
        }
 
+       /**
+        * Mount the Dataset
+        *
+        * @return void
+        * @access public
+        */
+       public function mount() {
+               $cmd = "zfs mount " . $this->name . " 2>&1";
+               $this->exec($cmd,$out,$res);
+               $this->updateProperty("mounted");
+       }
+
+       /**
+        * Unmount the Dataset
+        *
+        * @return void
+        * @access public
+        */
+       public function unmount() {
+               $cmd = "zfs unmount " . $this->name . " 2>&1";
+               $this->exec($cmd,$out,$res);
+               $this->updateProperty("mounted");
+       }
+
+
        /**
         * Helper function to execute a command and throw an exception on error
         * (requires stderr redirected to stdout for proper exception message).
This page took 0.031322 seconds and 5 git commands to generate.