Last active
February 13, 2016 08:18
-
-
Save codeopensrc/719a50065d9b16726d8a to your computer and use it in GitHub Desktop.
Quickly create multiple client .ovpn's from a template .ovpn
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 | |
# First of course, build your key(s) using `./build-key my-new-client` in the /etc/openvpn/easy-rsa dir | |
# Within the /etc/openvpn/easy-rsa/keys directory | |
# (or wherever you have your built-keys at) | |
# bash createClientOvpn.sh my-template-ovpn my-new-client Think cp command | |
# or ./createClientOvpn.sh my-template-ovpn my-new-client2 | |
cp $1.ovpn $2.ovpn; | |
echo "<ca>" >> $2.ovpn; | |
cat ca.crt >> $2.ovpn; | |
echo -e "</ca>\n<cert>" >> $2.ovpn; | |
cat $2.crt >> $2.ovpn; | |
echo -e "</cert>\n<key>" >> $2.ovpn; | |
cat $2.key >> $2.ovpn; | |
echo "</key>" >> $2.ovpn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment