mirror of
https://github.com/MarkusMcNugen/docker-qBittorrentvpn
synced 2024-11-14 14:44:57 +00:00
268480358d
Added transmission settings to env vars. Fixed #8. Updated readme. Added ability to override /etc/resolv.conf. Fixes #4. Save docker image size by combining all apt commands into a single RUN statement.
42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ ! -z "$OPEN_VPN_CONFIG" ]
|
|
then
|
|
if [ -f /etc/openvpn/"${OPEN_VPN_CONFIG}".ovpn ]
|
|
then
|
|
echo "Starting OpenVPN using config ${OPEN_VPN_CONFIG}.ovpn"
|
|
OPEN_VPN_CONFIG=/etc/openvpn/${OPEN_VPN_CONFIG}.ovpn
|
|
else
|
|
echo "Supplied config ${OPEN_VPN_CONFIG}.ovpn could not be found."
|
|
echo "Using default OpenVPN gateway: Netherlands"
|
|
OPEN_VPN_CONFIG=/etc/openvpn/Netherlands.ovpn
|
|
fi
|
|
else
|
|
echo "No VPN configuration provided. Using default: Netherlands"
|
|
OPEN_VPN_CONFIG=/etc/openvpn/Netherlands.ovpn
|
|
fi
|
|
|
|
# override resolv.conf
|
|
if [ "$RESOLV_OVERRIDE" != "**None**" ];
|
|
then
|
|
echo "Overriding resolv.conf..."
|
|
printf "$RESOLV_OVERRIDE" > /etc/resolv.conf
|
|
fi
|
|
|
|
# add PIA user/pass
|
|
if [ "$PIA_USERNAME" != "**None**" ];
|
|
then
|
|
echo "Setting PIA credentials..."
|
|
mkdir -p /config
|
|
echo $PIA_USERNAME > /config/pia-credentials.txt
|
|
echo $PIA_PASSWORD >> /config/pia-credentials.txt
|
|
else
|
|
echo "Not setting PIA credentials."
|
|
fi
|
|
|
|
dockerize \
|
|
-template /etc/transmission-daemon/settings.json:/etc/transmission-daemon/settings.json \
|
|
true
|
|
|
|
exec openvpn --config "$OPEN_VPN_CONFIG"
|