summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol
diff options
context:
space:
mode:
authorSimon Rettberg2024-11-27 20:43:51 +0100
committerSimon Rettberg2024-11-27 20:43:51 +0100
commite52f630f38a40f6e62dccdcef2514975f6129f5f (patch)
treef2c26f16cb0310a2dd7d44bd2d81ff1c575eb129 /modules-available/rebootcontrol
parent[vmstore] Add common header to benchmark pages (diff)
downloadslx-admin-e52f630f38a40f6e62dccdcef2514975f6129f5f.tar.gz
slx-admin-e52f630f38a40f6e62dccdcef2514975f6129f5f.tar.xz
slx-admin-e52f630f38a40f6e62dccdcef2514975f6129f5f.zip
[rebootcontrol] Add exec job to list dnbd3-proxy cache
Diffstat (limited to 'modules-available/rebootcontrol')
-rw-r--r--modules-available/rebootcontrol/inc/exectemplate.inc.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/modules-available/rebootcontrol/inc/exectemplate.inc.php b/modules-available/rebootcontrol/inc/exectemplate.inc.php
index 483dc31f..59abc449 100644
--- a/modules-available/rebootcontrol/inc/exectemplate.inc.php
+++ b/modules-available/rebootcontrol/inc/exectemplate.inc.php
@@ -65,6 +65,27 @@ class ExecTemplate
[],
);
}
+ if ($id === '3') {
+ return new ExecTemplate('3', Dictionary::translateFileModule('rebootcontrol', 'module', 'exec_dnbd3_proxy_list'),
+ <<<EOF
+dir="/opt/openslx/persistent/data/dnbd3"
+if ! [ -d "\$dir" ]; then
+ echo "Could not find dnbd3 cache directory on persistent partiton. Are you sure this is a dnbd3-proxy?"
+ exit 1
+fi
+if command -v tree &> /dev/null; then
+ if tree --help 2>&1 | grep -qP '\s-I\s'; then
+ TREE_CHARSET=UTF-8 tree -h -I "*.crc" -I "*.meta" -I "*.map" "\$dir"
+ else
+ tree "\$dir" | grep -v -e '\.crc$' -e '\.meta$' -e '\.map$'
+ fi
+else
+ find "\$dir" -type f \! \( -name "*.crc" -o -name "*.meta" -o -name "*.map" \)
+fi
+EOF,
+ [],
+ );
+ }
return null;
}
@@ -73,7 +94,7 @@ class ExecTemplate
*/
public static function list(): array
{
- return [self::get('1'), self::get('2')];
+ return [self::get('1'), self::get('2'), self::get('3')];
}
}
@@ -103,4 +124,4 @@ class ExecTemplateField
return '<div>???</div>';
}
-} \ No newline at end of file
+}