secrets support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-12-04 17:26:06 +01:00
parent 2a25c2771b
commit f4119771e1
2 changed files with 14 additions and 3 deletions

View File

@@ -18,18 +18,28 @@ CONFIGFILE="${CONFIGDIR}/barracudavpn.conf"
mkdir -p "${CONFIGDIR}"
if [ -z "${VPN_PASSWORD}" ]; then
echo "You need to specify the password (VPN_PASSWORD env variable)"
if [ -z "${VPN_PASSWORD}${VPN_PASSWORD_FILE}" ]; then
echo "You need to specify the password (VPN_PASSWORD or VPN_PASSWORD_FILE env variable)"
exit 1
fi
if [ ! -z "${VPN_PASSWORD_FILE}" ]; then
if [ ! -r "${LIC_FILE}" ]; then
echo "The specified password file (${VPN_PASSWORD_FILE}) is not readable"
exit 1
fi
fi
VPN_PASSWORD_FILE_CONTENT=$(cat "${VPN_PASSWORD_FILE}")
VPN_PASSWORD=${VPN_PASSWORD:-$VPN_PASSWORD_FILE_CONTENT}
if [ -z "${LIC_FILE}" ]; then
echo "You need to specify the path to the license file (LIC_FILE env variable)"
exit 1
fi
if [ ! -r "${LIC_FILE}" ]; then
echo "The license file is not readable"
echo "The license file (${LIC_FILE}) is not readable"
exit 1
fi