30 lines
375 B
Bash
Executable File
30 lines
375 B
Bash
Executable File
#!/bin/bash
|
|
|
|
OPENVPN_DIR=/etc/openvpn
|
|
|
|
type=$1
|
|
host=$2
|
|
|
|
case "${type}"
|
|
in
|
|
"ca")
|
|
cat ${OPENVPN_DIR}/tls/certs/ca.crt
|
|
;;
|
|
|
|
"tc")
|
|
cat ${OPENVPN_DIR}/tls/private/tc.key
|
|
;;
|
|
|
|
"key")
|
|
cat ${OPENVPN_DIR}/tls/private/${host}.key
|
|
;;
|
|
|
|
"csr")
|
|
cat ${OPENVPN_DIR}/tls/certs/${host}.csr
|
|
;;
|
|
|
|
"crt")
|
|
cat ${OPENVPN_DIR}/tls/certs/${host}.crt
|
|
;;
|
|
esac
|