From 9e3fe4791f8470590621a1cca8bd761f36b78f77 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sat, 11 Jun 2022 02:08:02 +0100 Subject: [PATCH] Remove unnecessary subshell from 'date' evaluation If this 'date' is MacPorts then it will fall throught to: * This *is* the bottom-line, "date-wise": Ubuntu or busybox. Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 3603b83..5db7ef1 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -2965,15 +2965,7 @@ The fixed date will be rolled backward by one year." )" # Darwin, BSD - elif ( - case "$easyrsa_uname" in - (Darwin|*BSD) - # Not MacPorts GNU date - date -j && return - esac - return 1 - ) - then + elif date -j > /dev/null 2>&1; then this_year_n="$(date -j +%y)" today_n="$(date -u -j +%j)" @@ -2990,8 +2982,8 @@ The fixed date will be rolled backward by one year." fi New_Year_day_d="$( - date -u -j -f '%y%m%d%H%M%S' "${this_year_n}0101000001" \ - '+%Y%m%d%H%M.%SZ' + date -u -j -f %y%m%d%H%M%S "${this_year_n}0101000001" \ + +%Y%m%d%H%M.%SZ )" # Convert to date-stamps for SSL input