Merge pull request #674 from darko-poljak/fix-letsencrypt-tempfile

Fix temp file location and removal
This commit is contained in:
Darko Poljak 2018-06-20 09:23:43 +02:00 committed by GitHub
commit 4cee4abf7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ case "${state}" in
;; ;;
present) present)
domain_param_file="${__object}/parameter/domain" domain_param_file="${__object}/parameter/domain"
requested_domains=$(mktemp domain.cdist.XXXXXXXXXX) requested_domains=$(mktemp "${TMPDIR:-/tmp}/domain.cdist.XXXXXXXXXX")
if [ -f "${domain_param_file}" ]; then if [ -f "${domain_param_file}" ]; then
cp "${domain_param_file}" "${requested_domains}" cp "${domain_param_file}" "${requested_domains}"
else else
@ -66,6 +66,7 @@ case "${state}" in
echo "--domain '${domain}' \\" echo "--domain '${domain}' \\"
done < "${requested_domains}") done < "${requested_domains}")
EOF EOF
rm -f "${requested_domains}"
if [ "${certificate_exists}" = "no" ]; then if [ "${certificate_exists}" = "no" ]; then
echo create >> "${__messages_out}" echo create >> "${__messages_out}"