mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-08 05:55:18 +02:00
added option to automatically run cleanup routine (implements #389)
This commit is contained in:
+8
-1
@@ -131,6 +131,7 @@ load_config() {
|
|||||||
OCSP_MUST_STAPLE="no"
|
OCSP_MUST_STAPLE="no"
|
||||||
IP_VERSION=
|
IP_VERSION=
|
||||||
CHAINCACHE=
|
CHAINCACHE=
|
||||||
|
AUTO_CLEANUP="no"
|
||||||
|
|
||||||
if [[ -z "${CONFIG:-}" ]]; then
|
if [[ -z "${CONFIG:-}" ]]; then
|
||||||
echo "#" >&2
|
echo "#" >&2
|
||||||
@@ -1009,6 +1010,10 @@ command_sign_domains() {
|
|||||||
# remove temporary domains.txt file if used
|
# remove temporary domains.txt file if used
|
||||||
[[ -n "${PARAM_DOMAIN:-}" ]] && rm -f "${DOMAINS_TXT}"
|
[[ -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"
|
[[ -n "${HOOK}" ]] && "${HOOK}" "exit_hook"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@@ -1095,7 +1100,9 @@ command_revoke() {
|
|||||||
# Usage: --cleanup (-gc)
|
# Usage: --cleanup (-gc)
|
||||||
# Description: Move unused certificate files to archive directory
|
# Description: Move unused certificate files to archive directory
|
||||||
command_cleanup() {
|
command_cleanup() {
|
||||||
load_config
|
if [ ! "${1:-}" = "noinit" ]; then
|
||||||
|
load_config
|
||||||
|
fi
|
||||||
|
|
||||||
# Create global archive directory if not existent
|
# Create global archive directory if not existent
|
||||||
if [[ ! -e "${BASEDIR}/archive" ]]; then
|
if [[ ! -e "${BASEDIR}/archive" ]]; then
|
||||||
|
|||||||
@@ -95,3 +95,6 @@
|
|||||||
|
|
||||||
# Issuer chain cache directory (default: $BASEDIR/chains)
|
# Issuer chain cache directory (default: $BASEDIR/chains)
|
||||||
#CHAINCACHE="${BASEDIR}/chains"
|
#CHAINCACHE="${BASEDIR}/chains"
|
||||||
|
|
||||||
|
# Automatic cleanup (default: no)
|
||||||
|
#AUTO_CLEANUP="no"
|
||||||
|
|||||||
Reference in New Issue
Block a user