letsencrypt: improve active status check

Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
nachoparker 2021-09-18 18:57:56 -06:00
parent 110311fef6
commit f3e3b01ab5
3 changed files with 18 additions and 3 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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