mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-14 16:17:03 +01:00
Add option to allow multiple devices per client profile (duplicate-cn) (#1278)
Added duplicate-cn for connecting multiple clients using same .ovpn --------- Co-authored-by: Stanislas Lange <git@slange.me>
This commit is contained in:
@@ -413,7 +413,7 @@ function installQuestions() {
|
||||
if [[ $APPROVE_IP =~ n ]]; then
|
||||
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
|
||||
log_menu ""
|
||||
log_prompt "It seems this server is behind NAT. What is its public IPv4 address or hostname?"
|
||||
@@ -533,6 +533,13 @@ function installQuestions() {
|
||||
fi
|
||||
done
|
||||
log_menu ""
|
||||
read -rp "Allow a single .ovpn profile to be used on multiple devices simultaneously? [y/n]: " -e -i n MULTI_CLIENT_CHOICE
|
||||
if [[ $MULTI_CLIENT_CHOICE =~ ^[Yy]$ ]]; then
|
||||
MULTI_CLIENT="y"
|
||||
else
|
||||
MULTI_CLIENT="n"
|
||||
fi
|
||||
log_menu ""
|
||||
log_prompt "Do you want to use compression? It is not recommended since the VORACLE attack makes use of it."
|
||||
until [[ $COMPRESSION_ENABLED =~ (y|n) ]]; do
|
||||
read -rp "Enable compression? [y/n]: " -e -i n COMPRESSION_ENABLED
|
||||
@@ -984,6 +991,10 @@ function installOpenVPN() {
|
||||
echo "proto ${PROTOCOL}6" >>/etc/openvpn/server.conf
|
||||
fi
|
||||
|
||||
if [[ $MULTI_CLIENT == "y" ]]; then
|
||||
echo "duplicate-cn" >>/etc/openvpn/server.conf
|
||||
fi
|
||||
|
||||
echo "dev tun
|
||||
user nobody
|
||||
group $NOGROUP
|
||||
|
||||
Reference in New Issue
Block a user