mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-23 09:31:00 +01:00
added option to automatically run cleanup routine (implements #389)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -95,3 +95,6 @@
|
||||
|
||||
# Issuer chain cache directory (default: $BASEDIR/chains)
|
||||
#CHAINCACHE="${BASEDIR}/chains"
|
||||
|
||||
# Automatic cleanup (default: no)
|
||||
#AUTO_CLEANUP="no"
|
||||
|
||||
Reference in New Issue
Block a user