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

Commit 78637fc

Browse files
authored
Merge pull request #28 from Toanzzz/feature/pass-ovpn-auth
Allow passing auth file to authenticate with OpenVPN server
2 parents 32e3baf + 48fad83 commit 78637fc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

data/scripts/entry.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,20 @@ if [ "$SOCKS_PROXY" = "on" ]; then
181181
/data/scripts/dante_wrapper.sh &
182182
fi
183183

184+
ovpn_auth_flag=''
185+
if [ -n "$OPENVPN_AUTH_SECRET" ]; then
186+
if [ -f "/run/secrets/$OPENVPN_AUTH_SECRET" ]; then
187+
echo "Configuring OpenVPN authentication."
188+
ovpn_auth_flag="--auth-user-pass /run/secrets/$OPENVPN_AUTH_SECRET"
189+
else
190+
echo "WARNING: OpenVPN Credentials secrets fail to read."
191+
fi
192+
fi
193+
184194
echo -e "Running OpenVPN client.\n"
185195

186196
openvpn --config "$config_file_modified" \
197+
$ovpn_auth_flag \
187198
--verb "$vpn_log_level" \
188199
--auth-nocache \
189200
--connect-retry-max 10 \

0 commit comments

Comments
 (0)