diff options
author | Sameer Naik <sameer@damagehead.com> | 2015-12-27 17:22:59 +0300 |
---|---|---|
committer | Sameer Naik <sameer@damagehead.com> | 2015-12-29 19:15:06 +0300 |
commit | 93824f4145a2574bc5f6c5f65e8816e3134274e7 (patch) | |
tree | 1934f8d9902f5bcf0f20da8f82493aea88ff5d00 /assets | |
parent | 67d06e8c08fdd066489037a4542bb5168073de5b (diff) |
added utility function `owncloud_get_param`
Diffstat (limited to 'assets')
-rw-r--r-- | assets/runtime/functions | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/assets/runtime/functions b/assets/runtime/functions index 961e5ca..df18078 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -75,12 +75,17 @@ update_template() { rm -f ${tmp_file} } +owncloud_get_param() { + local key=${1?missing argument} + exec_as_owncloud sed -n -e "s/\([ ]*\)\('${key}' => '\)\([^ ']*\)\(.*\)$/\3/p" ${OWNCLOUD_CONFIG_PHP} +} + owncloud_set_param() { local key=${1} local value=${2} local hide=${3} if [[ -n ${value} ]]; then - local current=$(exec_as_owncloud sed -n -e "s/\([ ]*\)\('${key}' => '\)\([^ ']*\)\(.*\)$/\3/p" ${OWNCLOUD_CONFIG_PHP}) + local current=$(owncloud_get_param ${key}) if [[ "${current}" != "${value}" ]]; then case ${hide} in true) echo "‣ Setting config.php parameter: ${key}" ;; |