From 456fbf189d640bb2f735b6463ba98f34b92590eb Mon Sep 17 00:00:00 2001 From: Nyr Date: Sat, 15 Dec 2018 21:26:14 +0100 Subject: [PATCH] Cleaner .ovpn files --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 8b56327..0c78e50 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -42,13 +42,13 @@ newclient () { cat /etc/openvpn/easy-rsa/pki/ca.crt >> ~/$1.ovpn echo "" >> ~/$1.ovpn echo "" >> ~/$1.ovpn - cat /etc/openvpn/easy-rsa/pki/issued/$1.crt >> ~/$1.ovpn + sed -ne '/BEGIN CERTIFICATE/,$ p' /etc/openvpn/easy-rsa/pki/issued/$1.crt >> ~/$1.ovpn echo "" >> ~/$1.ovpn echo "" >> ~/$1.ovpn cat /etc/openvpn/easy-rsa/pki/private/$1.key >> ~/$1.ovpn echo "" >> ~/$1.ovpn echo "" >> ~/$1.ovpn - cat /etc/openvpn/ta.key >> ~/$1.ovpn + sed -ne '/BEGIN OpenVPN Static key/,$ p' /etc/openvpn/ta.key >> ~/$1.ovpn echo "" >> ~/$1.ovpn }