From: Don Armstrong Date: Sat, 5 Apr 2014 01:14:14 +0000 (-0700) Subject: make days be always close to the end of the unix epoch X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c37703e1e6af1e2d57fa539105be11d2a9717702;p=bin.git make days be always close to the end of the unix epoch --- 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}"