mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-12-04 22:45:32 +01:00
add CLIENT_FILEPATH environment variable support
This environment variable can be set to customize destination of .ovpn file to generate. If defined, it should contain the full path of the file to generate.
This commit is contained in:
parent
610d42e6b2
commit
1182e98aed
@ -1093,6 +1093,7 @@ function newClient() {
|
|||||||
echo "Client $CLIENT added."
|
echo "Client $CLIENT added."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$CLIENT_FILEPATH" ]]; then
|
||||||
# Home directory of the user, where the client configuration will be written
|
# Home directory of the user, where the client configuration will be written
|
||||||
if [ -e "/home/${CLIENT}" ]; then
|
if [ -e "/home/${CLIENT}" ]; then
|
||||||
# if $1 is a user name
|
# if $1 is a user name
|
||||||
@ -1113,6 +1114,7 @@ function newClient() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CLIENT_FILEPATH="$homeDir/$CLIENT.ovpn"
|
CLIENT_FILEPATH="$homeDir/$CLIENT.ovpn"
|
||||||
|
fi
|
||||||
|
|
||||||
# Determine if we use tls-auth or tls-crypt
|
# Determine if we use tls-auth or tls-crypt
|
||||||
if grep -qs "^tls-crypt" /etc/openvpn/server.conf; then
|
if grep -qs "^tls-crypt" /etc/openvpn/server.conf; then
|
||||||
|
Loading…
Reference in New Issue
Block a user