From 990e1baf97b94ad3ffa8bc587241369bd73c607e Mon Sep 17 00:00:00 2001 From: Niclas Berglind Date: Tue, 4 Mar 2014 22:00:10 +0100 Subject: [PATCH] Added mount and unmount methods to the Dataset class Signed-off-by: Niclas Berglind --- src/Dataset.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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). -- 2.39.2