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:
authornachoparker <nacho@ownyourbits.com>2021-09-19 03:57:56 +0300
committernachoparker <nacho@ownyourbits.com>2021-09-20 18:59:35 +0300
commitf3e3b01ab54ff6b8827683f451323fdb8d9ce5cf (patch)
tree916ffc664785133d44d57e87f055cc41000b994e
parent110311fef611366bb91521c02b0f43ceccecd0bd (diff)
letsencrypt: improve active status checkv1.39.3
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--bin/ncp/NETWORKING/letsencrypt.sh2
-rw-r--r--changelog.md4
-rw-r--r--etc/library.sh15
3 files changed, 18 insertions, 3 deletions
diff --git a/bin/ncp/NETWORKING/letsencrypt.sh b/bin/ncp/NETWORKING/letsencrypt.sh
index 06cfe5a4..a70b06c1 100644
--- a/bin/ncp/NETWORKING/letsencrypt.sh
+++ b/bin/ncp/NETWORKING/letsencrypt.sh
@@ -15,7 +15,7 @@ letsencrypt=/usr/bin/letsencrypt
is_active()
{
- [[ $( find /etc/letsencrypt/live/ -maxdepth 0 -empty | wc -l ) == 0 ]]
+ [[ "${ACTIVE}" == "yes" ]] && [[ $( find /etc/letsencrypt/live/ -maxdepth 0 -empty | wc -l ) == 0 ]]
}
tmpl_letsencrypt_domain() {
diff --git a/changelog.md b/changelog.md
index 9255f50b..6b935d61 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,7 @@
-[v1.39.2](https://github.com/nextcloud/nextcloudpi/commit/9598430) (2021-09-18) nextcloud-domain: make sure redis is running before it starts
+[v1.39.3](https://github.com/nextcloud/nextcloudpi/commit/295144c) (2021-09-18) letsencrypt: improve active status check
+
+[v1.39.2 ](https://github.com/nextcloud/nextcloudpi/commit/fb5a2f3) (2021-09-18) nextcloud-domain: make sure redis is running before it starts
[v1.39.1 ](https://github.com/nextcloud/nextcloudpi/commit/6290c1f) (2021-09-09) nc-static-IP: take into account httpsonly
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