Created
September 17, 2019 09:50
-
-
Save bigpresh/aadf6c04c7a930b2895714d3840d4a43 to your computer and use it in GitHub Desktop.
gen-client-tarball.sh
This file contains hidden or 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
[davidp@supernova:~/openvpn-easy-rsa]$ cat gen-client-tarball | |
#!/bin/bash | |
# Call with a client name, it will create a tarball named after that client | |
# containing keys/$CLIENT.{key,crt} and keys/ca.crt ready to provide | |
CLIENT=$1 | |
TARBALL=$CLIENT-openvpn-keys.tar.gz | |
if [[ ! -f keys/$CLIENT.key ]]; then | |
echo "FAIL: keys/$CLIENT.key not found"; | |
echo "Did you typo, or forget to generate them with ./build-key $CLIENT ?" | |
exit 1; | |
fi | |
tar cvvfz $TARBALL -C keys/ $CLIENT.{crt,key} ca.crt | |
echo "Keys and CA cert should be in $TARBALL" | |
echo "Copy it to the client, then extract to /etc/openvpn, e.g.:" | |
echo "sudo tar -C /etc/openvpn -xzvf $CLIENT-openvpn-keys.tar.gz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment