This commit is contained in:
parent
2a25c2771b
commit
f4119771e1
@ -18,6 +18,7 @@ services:
|
|||||||
- /dev/net/tun # needed for tap access
|
- /dev/net/tun # needed for tap access
|
||||||
environment:
|
environment:
|
||||||
VPN_PASSWORD: "ThePassw0rd"
|
VPN_PASSWORD: "ThePassw0rd"
|
||||||
|
# VPN_PASSWORD_FILE: /run/secrets/MYPASSWD # example with docker secrets file
|
||||||
SERVER: vpn.server.it
|
SERVER: vpn.server.it
|
||||||
LIC_FILE: /config/vpn.lic
|
LIC_FILE: /config/vpn.lic
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -18,18 +18,28 @@ CONFIGFILE="${CONFIGDIR}/barracudavpn.conf"
|
|||||||
|
|
||||||
mkdir -p "${CONFIGDIR}"
|
mkdir -p "${CONFIGDIR}"
|
||||||
|
|
||||||
if [ -z "${VPN_PASSWORD}" ]; then
|
if [ -z "${VPN_PASSWORD}${VPN_PASSWORD_FILE}" ]; then
|
||||||
echo "You need to specify the password (VPN_PASSWORD env variable)"
|
echo "You need to specify the password (VPN_PASSWORD or VPN_PASSWORD_FILE env variable)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
if [ -z "${LIC_FILE}" ]; then
|
||||||
echo "You need to specify the path to the license file (LIC_FILE env variable)"
|
echo "You need to specify the path to the license file (LIC_FILE env variable)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -r "${LIC_FILE}" ]; then
|
if [ ! -r "${LIC_FILE}" ]; then
|
||||||
echo "The license file is not readable"
|
echo "The license file (${LIC_FILE}) is not readable"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user