Delete existing vpn certs if needed
This commit is contained in:
parent
0a44e11e3f
commit
76f8d4e47c
|
@ -152,6 +152,17 @@ function create_user_vpn_key {
|
||||||
echo $"Creating VPN key for $username"
|
echo $"Creating VPN key for $username"
|
||||||
|
|
||||||
cd /etc/openvpn/easy-rsa
|
cd /etc/openvpn/easy-rsa
|
||||||
|
|
||||||
|
if [ -f /etc/openvpn/easy-rsa/keys/$username.crt ]; then
|
||||||
|
rm /etc/openvpn/easy-rsa/keys/$username.crt
|
||||||
|
fi
|
||||||
|
if [ -f /etc/openvpn/easy-rsa/keys/$username.key ]; then
|
||||||
|
rm /etc/openvpn/easy-rsa/keys/$username.key
|
||||||
|
fi
|
||||||
|
if [ -f /etc/openvpn/easy-rsa/keys/$username.csr ]; then
|
||||||
|
rm /etc/openvpn/easy-rsa/keys/$username.csr
|
||||||
|
fi
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
|
||||||
|
|
||||||
|
@ -282,6 +293,17 @@ function install_vpn {
|
||||||
exit 7392353
|
exit 7392353
|
||||||
fi
|
fi
|
||||||
cp openssl-${vpn_openssl_version}.cnf openssl.cnf
|
cp openssl-${vpn_openssl_version}.cnf openssl.cnf
|
||||||
|
|
||||||
|
if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
|
||||||
|
rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt
|
||||||
|
fi
|
||||||
|
if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key ]; then
|
||||||
|
rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.key
|
||||||
|
fi
|
||||||
|
if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr ]; then
|
||||||
|
rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr
|
||||||
|
fi
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue