Skip to content

Commit

Permalink
letsencrypt.sh hook script: work with TOKEN_VALUE starting with -.
Browse files Browse the repository at this point in the history
argparse refuses to accept `--option -foo` but reliably accepts
`--option=-foo` syntax (https://bugs.python.org/issue9334).

Also fixed $@ -> "$@".  Probably makes no difference
(don't think args provided by letsencrypt can contain spaces)
but the only reason to use $@ over $* is its 1:1 expansion in "$@"...
  • Loading branch information
cben committed Apr 11, 2016
1 parent 1d23154 commit 34c8e08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/letsencrypt.default.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function deploy_challenge {

echo "deploy_challenge called: ${DOMAIN}, ${TOKEN_FILENAME}, ${TOKEN_VALUE}"

lexicon $PROVIDER create ${DOMAIN} TXT --name "_acme-challenge.${DOMAIN}." --content "${TOKEN_VALUE}"
lexicon $PROVIDER create ${DOMAIN} TXT --name="_acme-challenge.${DOMAIN}." --content="${TOKEN_VALUE}"

sleep 30

Expand All @@ -40,7 +40,7 @@ function clean_challenge {

echo "clean_challenge called: ${DOMAIN}, ${TOKEN_FILENAME}, ${TOKEN_VALUE}"

lexicon $PROVIDER delete ${DOMAIN} TXT --name "_acme-challenge.${DOMAIN}." --content "${TOKEN_VALUE}"
lexicon $PROVIDER delete ${DOMAIN} TXT --name="_acme-challenge.${DOMAIN}." --content="${TOKEN_VALUE}"

# This hook is called after attempting to validate each domain,
# whether or not validation was successful. Here you can delete
Expand Down Expand Up @@ -94,4 +94,4 @@ function unchanged_cert {
# The path of the file containing the intermediate certificate(s).
}

HANDLER=$1; shift; $HANDLER $@
HANDLER=$1; shift; $HANDLER "$@"

0 comments on commit 34c8e08

Please sign in to comment.