Allow a pre-existing /config/openvpn-credentials.txt file.

Instead of bailing when the OpenVPN user and password aren't defined in the environment, first check and see if we already have a /config/openvpn-credentials.txt file from a persistent volume.
This commit is contained in:
Ken Sanislo
2017-12-31 19:06:18 -08:00
committed by GitHub
parent a0113f4441
commit 0af676b481

View File

@@ -27,8 +27,11 @@ fi
# add OpenVPN user/pass
if [ "${OPENVPN_USERNAME}" = "**None**" ] || [ "${OPENVPN_PASSWORD}" = "**None**" ] ; then
echo "OpenVPN credentials not set. Exiting."
exit 1
if [ ! -f /config/openvpn-credentials.txt ] ; then
echo "OpenVPN credentials not set. Exiting."
exit 1
fi
echo "Found existing OPENVPN credentials..."
else
echo "Setting OPENVPN credentials..."
mkdir -p /config