With the following awk commands one can simply extract ca, cert and key files:
awk '/<ca>/{flag=1;next}/<\/ca>/{flag=0}flag' client.ovpn > server-ca.pem awk '/<cert>/{flag=1;next}/<\/cert>/{flag=0}flag' client.ovpn > server.crt awk '/<key>/{flag=1;next}/<\/key>/{flag=0}flag' client.ovpn > server.key
In a word… Indispensible. I work with OpenVPN a lot and this little ditty is going in a bash script – Many thanks 😀
How do you do this?
Install awk on whatever machine your running, open a command line and run the commands on your respective .ovpn file