non-interactive vpn install
This commit is contained in:
parent
76f8d4e47c
commit
fdaad4e96f
|
@ -163,19 +163,8 @@ function create_user_vpn_key {
|
||||||
rm /etc/openvpn/easy-rsa/keys/$username.csr
|
rm /etc/openvpn/easy-rsa/keys/$username.csr
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo '
|
sed -i 's| --interact||g' build-key
|
||||||
|
./build-key "$username"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
y
|
|
||||||
y
|
|
||||||
' | ./build-key "$username"
|
|
||||||
|
|
||||||
if [ ! -f /etc/openvpn/easy-rsa/keys/$username.crt ]; then
|
if [ ! -f /etc/openvpn/easy-rsa/keys/$username.crt ]; then
|
||||||
echo $'VPN user cert not generated'
|
echo $'VPN user cert not generated'
|
||||||
|
@ -303,29 +292,10 @@ function install_vpn {
|
||||||
if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr ]; then
|
if [ -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr ]; then
|
||||||
rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr
|
rm /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.csr
|
||||||
fi
|
fi
|
||||||
|
sed -i 's| --interact||g' build-key-server
|
||||||
echo '
|
sed -i 's| --interact||g' build-ca
|
||||||
|
./build-ca
|
||||||
|
./build-key-server $OPENVPN_SERVER_NAME
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' | ./build-ca
|
|
||||||
echo '
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
y
|
|
||||||
y
|
|
||||||
' | ./build-key-server $OPENVPN_SERVER_NAME
|
|
||||||
if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
|
if [ ! -f /etc/openvpn/easy-rsa/keys/${OPENVPN_SERVER_NAME}.crt ]; then
|
||||||
echo $'OpenVPN crt not found'
|
echo $'OpenVPN crt not found'
|
||||||
exit 7823352
|
exit 7823352
|
||||||
|
|
Loading…
Reference in New Issue