Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #28 from Toanzzz/feature/pass-ovpn-auth
Browse files Browse the repository at this point in the history
Allow passing auth file to authenticate with OpenVPN server
  • Loading branch information
wfg authored Jun 10, 2021
2 parents 32e3baf + 48fad83 commit 78637fc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions data/scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,20 @@ if [ "$SOCKS_PROXY" = "on" ]; then
/data/scripts/dante_wrapper.sh &
fi

ovpn_auth_flag=''
if [ -n "$OPENVPN_AUTH_SECRET" ]; then
if [ -f "/run/secrets/$OPENVPN_AUTH_SECRET" ]; then
echo "Configuring OpenVPN authentication."
ovpn_auth_flag="--auth-user-pass /run/secrets/$OPENVPN_AUTH_SECRET"
else
echo "WARNING: OpenVPN Credentials secrets fail to read."
fi
fi

echo -e "Running OpenVPN client.\n"

openvpn --config "$config_file_modified" \
$ovpn_auth_flag \
--verb "$vpn_log_level" \
--auth-nocache \
--connect-retry-max 10 \
Expand Down

0 comments on commit 78637fc

Please sign in to comment.