mirror of
https://github.com/namibia/openvpn-install.git
synced 2024-12-31 18:41:47 +00:00
parent
a0027f1b42
commit
f023de298d
21
README.md
21
README.md
@ -37,6 +37,27 @@ In your home directory, you will have `.ovpn` files. These are the client config
|
|||||||
|
|
||||||
If you have any question, head to the [FAQ](#faq) first.
|
If you have any question, head to the [FAQ](#faq) first.
|
||||||
|
|
||||||
|
### Headless install
|
||||||
|
|
||||||
|
It's also possible to run the script headless, e.g. without waiting for user input, in an automated manner.
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
```bash
|
||||||
|
export APPROVE_INSTALL=y
|
||||||
|
export APPROVE_IP=y
|
||||||
|
export IPV6_SUPPORT=n
|
||||||
|
export PORT_CHOICE=1
|
||||||
|
export PROTOCOL_CHOICE=1
|
||||||
|
export DNS=1
|
||||||
|
export COMPRESSION_ENABLED=n
|
||||||
|
export CUSTOMIZE_ENC=n
|
||||||
|
export CLIENT=clientname
|
||||||
|
export PASS=1
|
||||||
|
./openvpn-install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
If the server is behind NAT, you can specify its endpoint with the `PUBLICIP` variable. It the endpoint is the public IP address which it is behind, you can use `export PUBLICIP=$(curl ifconfig.co)`.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Installs and configures a ready-to-use OpenVPN server
|
- Installs and configures a ready-to-use OpenVPN server
|
||||||
|
@ -197,7 +197,10 @@ function installQuestions () {
|
|||||||
|
|
||||||
# Detect public IPv4 address and pre-fill for the user
|
# Detect public IPv4 address and pre-fill for the user
|
||||||
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
|
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
|
||||||
|
APPROVE_IP=${APPROVE_IP:-n}
|
||||||
|
if [[ $APPROVE_IP =~ n ]]; then
|
||||||
read -rp "IP address: " -e -i "$IP" IP
|
read -rp "IP address: " -e -i "$IP" IP
|
||||||
|
fi
|
||||||
# If $IP is a private IP address, the server must be behind NAT
|
# If $IP is a private IP address, the server must be behind NAT
|
||||||
if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
|
if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
|
||||||
echo ""
|
echo ""
|
||||||
@ -546,7 +549,10 @@ function installQuestions () {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Okay, that was all I needed. We are ready to setup your OpenVPN server now."
|
echo "Okay, that was all I needed. We are ready to setup your OpenVPN server now."
|
||||||
echo "You will be able to generate a client at the end of the installation."
|
echo "You will be able to generate a client at the end of the installation."
|
||||||
|
APPROVE_INSTALL=${APPROVE_INSTALL:-n}
|
||||||
|
if [[ $APPROVE_INSTALL =~ n ]]; then
|
||||||
read -n1 -r -p "Press any key to continue..."
|
read -n1 -r -p "Press any key to continue..."
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function installOpenVPN () {
|
function installOpenVPN () {
|
||||||
|
Loading…
Reference in New Issue
Block a user