diff options
author | Simon Rettberg | 2024-11-27 20:43:51 +0100 |
---|---|---|
committer | Simon Rettberg | 2024-11-27 20:43:51 +0100 |
commit | e52f630f38a40f6e62dccdcef2514975f6129f5f (patch) | |
tree | f2c26f16cb0310a2dd7d44bd2d81ff1c575eb129 /modules-available/rebootcontrol | |
parent | [vmstore] Add common header to benchmark pages (diff) | |
download | slx-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.php | 25 |
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 +} |