mirror of
https://github.com/MarkusMcNugen/docker-qBittorrentvpn
synced 2024-11-14 22:55:11 +00:00
Update start.sh
This commit is contained in:
parent
feb7c06f1d
commit
262559b513
@ -3,25 +3,26 @@ set -x
|
|||||||
|
|
||||||
# create directory to store openvpn config files
|
# create directory to store openvpn config files
|
||||||
if [ ! -d "/config/openvpn" ]; then
|
if [ ! -d "/config/openvpn" ]; then
|
||||||
mkdir -p /config/openvpn
|
mkdir -p /config/openvpn
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Locate first file with .ovpn extension
|
#Locate first file with .ovpn extension
|
||||||
export VPN_CONFIG=$(find /config/openvpn -maxdepth 1 -name "*.ovpn" -print -quit)
|
export VPN_CONFIG=$(find /config/openvpn -maxdepth 1 -name "*.ovpn" -print -quit)
|
||||||
|
|
||||||
if [[ -z "${VPN_CONFIG}" ]]; then
|
if [[ -z "${VPN_CONFIG}" ]]; then
|
||||||
echo "No ovpn file found. Add one to /config/openvpon abd restart this container, exiting..." | ts '%Y-%m-%d %H:%M:%.S' && exit 1
|
echo "No ovpn file found. Add one to /config/openvpon abd restart this container, exiting..." | ts '%Y-%m-%d %H:%M:%.S' && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add OpenVPN user/pass
|
# add OpenVPN user/pass
|
||||||
if [ "${OPENVPN_USERNAME}" = "**None**" ] || [ "${OPENVPN_PASSWORD}" = "**None**" ] ; then
|
if [ "${OPENVPN_USERNAME}" = "**None**" ] || [ "${OPENVPN_PASSWORD}" = "**None**" ] ; then
|
||||||
echo "OpenVPN credentials not set. Exiting."
|
echo "OpenVPN credentials not set. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Setting OPENVPN credentials..."
|
echo "Setting OPENVPN credentials..."
|
||||||
echo $OPENVPN_USERNAME > /config/openvpn/credentials.conf
|
echo $OPENVPN_USERNAME > /config/openvpn/credentials.conf
|
||||||
echo $OPENVPN_PASSWORD >> /config/openvpn/credentials.conf
|
echo $OPENVPN_PASSWORD >> /config/openvpn/credentials.conf
|
||||||
chmod 775 /config/openvpn/credentials.conf
|
chown -R "${PUID}":"${PGID}" /config/openvpn
|
||||||
|
chmod -R 775 /config/openvpn
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec openvpn --config "$VPN_CONFIG"
|
exec openvpn --config "$VPN_CONFIG"
|
||||||
|
Loading…
Reference in New Issue
Block a user