From: Niclas Berglind Date: Tue, 4 Mar 2014 21:00:10 +0000 (+0100) Subject: Added mount and unmount methods to the Dataset class X-Git-Url: http://git.datanom.net/omvzfs.git/commitdiff_plain/990e1baf97b94ad3ffa8bc587241369bd73c607e Added mount and unmount methods to the Dataset class Signed-off-by: Niclas Berglind --- diff --git a/src/Dataset.php b/src/Dataset.php index d6796e5..57e8edd 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -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).