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:
parent
0397827abe
commit
c137f57ab4
@ -187,11 +187,14 @@ else
|
||||
echo ""
|
||||
echo "First I need to know the IPv4 address of the network interface you want OpenVPN"
|
||||
echo "listening to."
|
||||
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"
|
||||
if [ $1 != "--silent" ]; then
|
||||
read -p "Protocol [1-2]: " -e -i 1 PROTOCOL
|
||||
case $PROTOCOL in
|
||||
1)
|
||||
@ -201,9 +204,16 @@ else
|
||||
PROTOCOL=tcp
|
||||
;;
|
||||
esac
|
||||
else
|
||||
PROTOCOL=udp
|
||||
fi
|
||||
echo ""
|
||||
echo "What port do you want OpenVPN listening to?"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user