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
1 changed files with 19 additions and 17 deletions
|
@ -1093,6 +1093,7 @@ function newClient() {
|
|||
echo "Client $CLIENT added."
|
||||
fi
|
||||
|
||||
if [[ -z "$CLIENT_FILEPATH" ]]; then
|
||||
# Home directory of the user, where the client configuration will be written
|
||||
if [ -e "/home/${CLIENT}" ]; then
|
||||
# if $1 is a user name
|
||||
|
@ -1113,6 +1114,7 @@ function newClient() {
|
|||
fi
|
||||
|
||||
CLIENT_FILEPATH="$homeDir/$CLIENT.ovpn"
|
||||
fi
|
||||
|
||||
# Determine if we use tls-auth or tls-crypt
|
||||
if grep -qs "^tls-crypt" /etc/openvpn/server.conf; then
|
||||
|
|
Loading…
Reference in a new issue