#!/bin/sh set -e cd "$(dirname "$(readlink -f "$0")")" test -f vpnca/pki/ca.crt && { echo "ERROR: vpnca/pki/ca.crt already exists; aborting (to build a new CA, completely remove ./vpnca)." >&2 ; exit 1 ; } make-cadir vpnca { cd vpnca ; export EASYRSA_BATCH=true ; ./easyrsa init-pki ; ./easyrsa gen-dh ; ./easyrsa --req-cn="VPN Test Root CA" build-ca nopass ; ./easyrsa build-server-full server.example.test nopass ; ./easyrsa build-client-full client.example.test nopass ; }