Skip to content

Commit

Permalink
Fix 'start_fix_sec' - date requires '-f input_format'
Browse files Browse the repository at this point in the history
Tested on macOS and FreeBSD.

Closes: #559

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed May 9, 2022
1 parent 55bdd02 commit a4e37cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit a4e37cf

Please sign in to comment.