diff --git a/build/build-dist.sh b/build/build-dist.sh index 5436ea8..eeb762f 100755 --- a/build/build-dist.sh +++ b/build/build-dist.sh @@ -79,7 +79,11 @@ stage_unix() { done # FreeBSD does not accept -i without argument in a way also acceptable by GNU sed - sed -i.tmp -e "s/~VER~/$VERSION/" "$DIST_ROOT/unix/$PV/easyrsa" || die "Cannot update easyrsa version" + sed -i.tmp -e "s/~VER~/$VERSION/" \ + -e "s/~DATE~/$(date)/" \ + -e "s/~HOST~/$(hostname -s)/" \ + -e "s/~GITHEAD~/$(git rev-parse HEAD)/" \ + "$DIST_ROOT/unix/$PV/easyrsa" || die "Cannot update easyrsa version data" rm -f "$DIST_ROOT/unix/$PV/easyrsa.tmp" # files not included @@ -116,6 +120,13 @@ stage_win() { cp -R "$SRC_ROOT/distro/windows/$f" "$DIST_ROOT/$win/$PV/" || die "failed to copy $f" unix2dos "$DIST_ROOT/$win/$PV/$f" || die "unix2dos conversion failed for $f" done + + sed -i.tmp -e "s/~VER~/$VERSION/" \ + -e "s/~DATE~/$(date)/" \ + -e "s/~HOST~/$(hostname -s)/" \ + -e "s/~GITHEAD~/$(git rev-parse HEAD)/" \ + "$DIST_ROOT/$win/$PV/easyrsa" || die "Cannot update easyrsa version data" + rm -f "$DIST_ROOT/$win/$PV/easyrsa.tmp" # files not included rm -rf "$DIST_ROOT/$win/$PV/doc/TODO" || die "failed rm TODO" diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 261336f..2e1250f 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -221,6 +221,7 @@ General options: --passout=ARG : set -passout ARG for openssl --pki-dir=DIR : declares the PKI directory --vars=FILE : define a specific 'vars' file to use for Easy-RSA config +--version : prints EasyRSA version and build information, then exits Certificate & Request options: (these impact cert/req field values) @@ -2319,6 +2320,18 @@ return 0 } # => up23_manage_upgrade_23 () +print_version() +{ + cat < print_version () ######################################## @@ -2398,6 +2411,9 @@ while :; do export EASYRSA_EXTRA_EXTS="\ $EASYRSA_EXTRA_EXTS subjectAltName = $val" ;; + --version) + print_version + ;; *) break ;; esac @@ -2498,6 +2514,9 @@ case "$cmd" in cmd_help "$1" exit 0 ;; + version) + print_version + ;; *) die "Unknown command '$cmd'. Run without commands for usage help." ;;