Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'etc/library.sh')
-rw-r--r--etc/library.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/etc/library.sh b/etc/library.sh
index b382bad0..01677652 100644
--- a/etc/library.sh
+++ b/etc/library.sh
@@ -246,7 +246,20 @@ function is_active_app()
# function
unset is_active
source "$script"
- [[ $( type -t is_active ) == function ]] && { is_active; return $?; }
+ [[ $( type -t is_active ) == function ]] && {
+ # read cfg parameters
+ [[ -f "$cfg_file" ]] && {
+ local cfg="$( cat "$cfg_file" )"
+ local len="$(jq '.params | length' <<<"$cfg")"
+ for (( i = 0 ; i < len ; i++ )); do
+ local var="$(jq -r ".params[$i].id" <<<"$cfg")"
+ local val="$(jq -r ".params[$i].value" <<<"$cfg")"
+ eval "$var=$val"
+ done
+ }
+ is_active
+ return $?;
+ }
# config
[[ -f "$cfg_file" ]] || return 1