From: Lukas Schauer Date: Mon, 10 Jul 2017 18:20:04 +0000 (+0200) Subject: added option to automatically run cleanup routine (implements #389) X-Git-Tag: v0.5.0~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6d6882c78c3f91ad6e296c058063a01a35c1a3d;p=thirdparty%2Fdehydrated.git added option to automatically run cleanup routine (implements #389) --- diff --git a/dehydrated b/dehydrated index b32bdc8..d7581cf 100755 --- a/dehydrated +++ b/dehydrated @@ -131,6 +131,7 @@ load_config() { OCSP_MUST_STAPLE="no" IP_VERSION= CHAINCACHE= + AUTO_CLEANUP="no" if [[ -z "${CONFIG:-}" ]]; then echo "#" >&2 @@ -1009,6 +1010,10 @@ command_sign_domains() { # remove temporary domains.txt file if used [[ -n "${PARAM_DOMAIN:-}" ]] && rm -f "${DOMAINS_TXT}" + if [[ "${AUTO_CLEANUP}" == "yes" ]]; then + echo "+ Running automatic cleanup" + command_cleanup noinit + fi [[ -n "${HOOK}" ]] && "${HOOK}" "exit_hook" exit 0 } @@ -1095,7 +1100,9 @@ command_revoke() { # Usage: --cleanup (-gc) # Description: Move unused certificate files to archive directory command_cleanup() { - load_config + if [ ! "${1:-}" = "noinit" ]; then + load_config + fi # Create global archive directory if not existent if [[ ! -e "${BASEDIR}/archive" ]]; then diff --git a/docs/examples/config b/docs/examples/config index 69cd724..e596c24 100644 --- a/docs/examples/config +++ b/docs/examples/config @@ -95,3 +95,6 @@ # Issuer chain cache directory (default: $BASEDIR/chains) #CHAINCACHE="${BASEDIR}/chains" + +# Automatic cleanup (default: no) +#AUTO_CLEANUP="no"