1
0
mirror of https://github.com/Nyr/openvpn-install.git synced 2024-11-23 21:46:08 +03:00

Adds --silent parameter which uses the default values for everything and a name of 'client'

This commit is contained in:
Claude Henchoz 2017-10-29 13:55:30 +01:00
parent 0397827abe
commit c137f57ab4

View File

@ -187,23 +187,33 @@ else
echo ""
echo "First I need to know the IPv4 address of the network interface you want OpenVPN"
echo "listening to."
read -p "IP address: " -e -i $IP IP
if [ $1 != "--silent" ]; then
read -p "IP address: " -e -i $IP IP
fi
echo ""
echo "Which protocol do you want for OpenVPN connections?"
echo " 1) UDP (recommended)"
echo " 2) TCP"
read -p "Protocol [1-2]: " -e -i 1 PROTOCOL
case $PROTOCOL in
1)
if [ $1 != "--silent" ]; then
read -p "Protocol [1-2]: " -e -i 1 PROTOCOL
case $PROTOCOL in
1)
PROTOCOL=udp
;;
2)
PROTOCOL=tcp
;;
esac
else
PROTOCOL=udp
;;
2)
PROTOCOL=tcp
;;
esac
fi
echo ""
echo "What port do you want OpenVPN listening to?"
read -p "Port: " -e -i 1194 PORT
if [ $1 != "--silent" ]; then
read -p "Port: " -e -i 1194 PORT
else
PORT=1194
fi
echo ""
echo "Which DNS do you want to use with the VPN?"
echo " 1) Current system resolvers"
@ -212,14 +222,24 @@ else
echo " 4) NTT"
echo " 5) Hurricane Electric"
echo " 6) Verisign"
read -p "DNS [1-6]: " -e -i 1 DNS
if [ $1 != "--silent" ]; then
read -p "DNS [1-6]: " -e -i 1 DNS
else
DNS=1
fi
echo ""
echo "Finally, tell me your name for the client certificate"
echo "Please, use one word only, no special characters"
read -p "Client name: " -e -i client CLIENT
if [ $1 != "--silent" ]; then
read -p "Client name: " -e -i client CLIENT
else
CLIENT=client
fi
echo ""
echo "Okay, that was all I needed. We are ready to setup your OpenVPN server now"
read -n1 -r -p "Press any key to continue..."
if [ $1 != "--silent" ]; then
read -n1 -r -p "Press any key to continue..."
fi
if [[ "$OS" = 'debian' ]]; then
apt-get update
apt-get install openvpn iptables openssl ca-certificates -y