Advertisement
CreadPag

openvpn.sh

Nov 16th, 2018
611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. #!/bin/bash
  2. # First argument: Client identifier
  3.  
  4. KEY_DIR=~/openvpn-ca/keys
  5. OUTPUT_DIR=~/client-configs/files
  6. BASE_CONFIG=~/client-configs/base.conf
  7.  
  8. cat ${BASE_CONFIG} \
  9.     <(echo -e '<ca>') \
  10.     ${KEY_DIR}/ca.crt \
  11.     <(echo -e '</ca>\n<cert>') \
  12.     ${KEY_DIR}/${1}.crt \
  13.     <(echo -e '</cert>\n<key>') \
  14.     ${KEY_DIR}/${1}.key \
  15.     <(echo -e '</key>\n<tls-auth>') \
  16.     ${KEY_DIR}/ta.key \
  17.     <(echo -e '</tls-auth>') \
  18.     > ${OUTPUT_DIR}/${1}.ovpn
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement