From a4e37cfe54167cca2610aa401b06caae6fa4f724 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Mon, 9 May 2022 17:37:16 +0100 Subject: [PATCH] Fix 'start_fix_sec' - date requires '-f input_format' Tested on macOS and FreeBSD. Closes: #559 Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 90f0e90..9aeca3f 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -1652,7 +1652,9 @@ Non-decimal value for EASYRSA_FIX_OFFSET: '$EASYRSA_FIX_OFFSET'" allow_renew_date="$(( now_sec + EASYRSA_CERT_RENEW * 86400 ))" if [ "$EASYRSA_FIX_OFFSET" ]; then - start_fix_sec="$(date -j "01010000${this_year}.00" +%s)" + start_fix_sec="$( + date -j -f '%Y%m%d%H%M%S' "${this_year}0101000000" +%s + )" end_fix_sec="$(( start_fix_sec + fix_days * 86400 ))" # Convert to date-stamps for SSL input start_fixdate="$(date -j -r "$start_fix_sec" +%Y%m%d%H%M%SZ)"