Skip to content

Commit

Permalink
refactor: docker-entrypoint.sh: move the renew hook command out
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhangs committed May 14, 2024
1 parent 8f1a581 commit 863f308
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ function usage () {
| awk '{gsub(/^[^ ]+.*/, "\033[1m&\033[0m"); print}'
}

#? Usage:
#? issue-tls-cert [--renew-hook "COMMAND"]
#?
function issue-tls-cert () {
# Check if the required environment variables are set
if [[ -z $DOMAIN ]]; then
Expand All @@ -99,7 +102,7 @@ function issue-tls-cert () {
fi

declare -a acme_common_opts=(--force-color --domain "$DOMAIN")
declare -a acme_issue_opts=("${acme_common_opts[@]}" --renew-hook reboot --dns)
declare -a acme_issue_opts=("${acme_common_opts[@]}" "$@" --dns)

# Setup DNS hook if DNS is set
if [[ -n $DNS ]]; then
Expand Down Expand Up @@ -151,7 +154,7 @@ function main () {

if [[ $V2RAY -eq 1 ]]; then
# Issue a TLS certificate
issue-tls-cert
issue-tls-cert --renew-hook reboot
fi

exec "$@"
Expand Down

0 comments on commit 863f308

Please sign in to comment.