summaryrefslogtreecommitdiffstats
path: root/modules-available/dnbd3/inc/dnbd3.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/dnbd3/inc/dnbd3.inc.php')
-rw-r--r--modules-available/dnbd3/inc/dnbd3.inc.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/modules-available/dnbd3/inc/dnbd3.inc.php b/modules-available/dnbd3/inc/dnbd3.inc.php
new file mode 100644
index 00000000..9607c544
--- /dev/null
+++ b/modules-available/dnbd3/inc/dnbd3.inc.php
@@ -0,0 +1,38 @@
+<?php
+
+class Dnbd3 {
+
+ const PROP_ENABLED = 'dnbd3.enabled';
+ const PROP_NFS_FALLBACK = 'dnbd3.nfs-fallback';
+
+ public static function isEnabled()
+ {
+ return Property::get(self::PROP_ENABLED, 0) ? true : false;
+ }
+
+ public static function setEnabled($bool)
+ {
+ Property::set(self::PROP_ENABLED, $bool ? 1 : 0);
+ $task = Taskmanager::submit('Systemctl', array(
+ 'operation' => ($bool ? 'start' : 'stop'),
+ 'service' => 'dnbd3-server'
+ ));
+ return $task;
+ }
+
+ public static function hasNfsFallback()
+ {
+ return Property::get(self::PROP_NFS_FALLBACK, 0) ? true : false;
+ }
+
+ public static function setNfsFallback($bool)
+ {
+ Property::set(self::PROP_NFS_FALLBACK, $bool ? 1 : 0);
+ }
+
+ public static function getLocalStatus()
+ {
+
+ }
+
+} \ No newline at end of file