Created
October 15, 2020 08:21
-
-
Save ZEROF/609cd0b87058576e59765ded4335d3f6 to your computer and use it in GitHub Desktop.
Extract the certificate and key from an .ovpn file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will extract the certificate and key from an .ovpn file | |
# into their own files, which makes it possible to use them to configure | |
# the VPN using Ubuntu's network manager | |
# Usage example: | |
# >> ovpnconvert username.dev.ovpn | |
sed '1,/<ca>/d;/<\/ca>/,$d' $1 > $1.ca.crt | |
sed '1,/<cert>/d;/<\/cert>/,$d' $1 > $1.client.crt | |
sed '1,/<key>/d;/<\/key>/,$d' $1 > $1.client.key | |
sed '1,/<tls-auth>/d;/<\/tls-auth>/,$d' $1 > $1.ta.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment