use uname/pass if provided

This commit is contained in:
wh1t3fox
2020-08-20 20:57:35 -04:00
parent 37ba593745
commit 5dbc3df6fe

View File

@ -14,4 +14,10 @@ if [[ -z "${config}" ]]; then
exit 1
fi
openvpn --config "${config}" --user user --group user --auth-nocache
PARAMS="--config ${config} --auth-nocache --user user --group user"
# Use UNAME/PASSWD if they were provided
if [[ ! $(grep -o 'generic' /dev/shm/auth_file) ]]; then
PARAMS+=" --auth-user-pass /dev/shm/auth_file "
fi
openvpn $PARAMS