#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions"

trigger-openresty-vhosts-certs-force() {
  declare desc="openresty-vhosts certs-force plugin trigger"
  declare trigger="certs-force"
  declare APP="$1"

  if [[ "$(plugn trigger proxy-type "$APP")" != "openresty" ]]; then
    return
  fi

  if [[ -n "$(fn-openresty-letsencrypt-email)" ]]; then
    echo true
  fi
}

trigger-openresty-vhosts-certs-force "$@"
