From c37703e1e6af1e2d57fa539105be11d2a9717702 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 4 Apr 2014 18:14:14 -0700 Subject: [PATCH] make days be always close to the end of the unix epoch --- add_openvpn_host | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add_openvpn_host b/add_openvpn_host index adcb633..4d5e54c 100755 --- a/add_openvpn_host +++ b/add_openvpn_host @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash HOST="${1}" CONF="${2:-danet_client.conf}" @@ -41,7 +41,7 @@ ORIGDIR=$(pwd); perl -e 'print unpack(q(H*),pack(q(NN),time,$$)),qq(\n)' > serial fi; openssl ca -config "$TMPDIR"/config -policy policy_anything -keyfile "${ORIGDIR}"/"${CAKEY}" -cert "${ORIGDIR}"/"${CACERT}" \ - -out "$TMPDIR"/"${HOST}".cert -outdir "$TMPDIR" -notext -days 9000 -batch -infiles "${HOST}".req; #> /dev/null 2>&1 + -out "$TMPDIR"/"${HOST}".cert -outdir "$TMPDIR" -notext -days $(( ( $(date -d 'Tuesday, 18 January 2038' +%s) - $(date +%s) ) / 60 / 60 /24 )) -batch -infiles "${HOST}".req; #> /dev/null 2>&1 chmod a+r "${HOST}".cert rm -f "${HOST}".req mv "${HOST}".cert "${CLIENT_CERT}" -- 2.39.5