cdist-contrib/type/__nextcloud/explorer/config
Matthias Stecher c24aedd4db __nextcloud: remove --webroot parameter
Because the detection of the webroot is not that good, it was removed.
Now, the object id contains the full path of the nextcloud installation.

This changes the installation process a bit, as it will download the
tarball to /tmp rather the webroot.

Also, this commit contains a bit overhaul work.
2020-11-15 16:21:56 +01:00

29 lines
1 KiB
Bash
Executable file

#!/bin/sh -e
# __nextcloud/explorer/config
# Checks the nextcloud configuration
# Get the installdir
installdir="/$__object_id"
# Check if the tools are available
if [ -d "$installdir" ]; then
cd "$installdir"
# if those files exist, everything should be good
if [ -f "occ" ] && [ -f "config/config.php" ]; then
# Dump out config instead of fuzz every possible option through
# `occ config:system:get`. Or parse through the whole json or
# yaml-like output of `occ config:list system --private`.
#
# shellcheck disable=SC2016 # cause of the php inline code
php -r 'require("lib/private/Config.php"); $config = new OC\Config("config/");
function printv($key, $value) {printf("%s = %s\n", $key, $value);}
foreach($config->getKeys() as $key){
$value = $config->getValue($key);
if(is_array($value)) foreach($value as $n => $in) printv($n."|".$key, $in);
else printv($key, $value);
};'
fi
fi