From b392e7da8b01d702b61b7b53e81fd062097f9e7e Mon Sep 17 00:00:00 2001 From: Nyr Date: Sun, 10 May 2020 20:02:08 +0200 Subject: [PATCH] Improved easy-rsa setup No need to write the tarball to disk. --- openvpn-install.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index f374e79..bab1d8d 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -219,12 +219,9 @@ LimitNPROC=infinity" > /etc/systemd/system/openvpn-server@server.service.d/disab fi # Get easy-rsa easy_rsa_url='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.7/EasyRSA-3.0.7.tgz' - wget -O ~/easyrsa.tgz "$easy_rsa_url" 2>/dev/null || curl -Lo ~/easyrsa.tgz "$easy_rsa_url" - tar xzf ~/easyrsa.tgz -C ~/ - mv ~/EasyRSA-3.0.7/ /etc/openvpn/server/ - mv /etc/openvpn/server/EasyRSA-3.0.7/ /etc/openvpn/server/easy-rsa/ + mkdir -p /etc/openvpn/server/easy-rsa/ + { wget -qO- "$easy_rsa_url" 2>/dev/null || curl -sL "$easy_rsa_url" ; } | tar xz -C /etc/openvpn/server/easy-rsa/ --strip-components 1 chown -R root:root /etc/openvpn/server/easy-rsa/ - rm -f ~/easyrsa.tgz cd /etc/openvpn/server/easy-rsa/ # Create the PKI, set up the CA and the server and client certificates ./easyrsa init-pki