Updated scripts based on latest release of docker-transmission-openvpn, updated Dockerfile, fetches now vpn config externally

This commit is contained in:
Eldwan Brianne
2021-10-03 18:47:35 +02:00
parent 9f0bc3c941
commit 3a04130588
10504 changed files with 735 additions and 772708 deletions

View File

@@ -3,14 +3,13 @@
set -e
# These are the possible bundles from PIA
# https://www.privateinternetaccess.com/openvpn/openvpn-nextgen.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-strong-nextgen.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-ip-nextgen.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-tcp-nextgen.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-strong-tcp-nextgen.zip
# https://www.privateinternetaccess.com/openvpn/openvpn.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-strong.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-tcp.zip
# https://www.privateinternetaccess.com/openvpn/openvpn-strong-tcp.zip
baseURL="https://www.privateinternetaccess.com/openvpn"
PIA_OPENVPN_CONFIG_BUNDLE=${PIA_OPENVPN_CONFIG_BUNDLE:-"openvpn-nextgen"}
PIA_OPENVPN_CONFIG_BUNDLE=${PIA_OPENVPN_CONFIG_BUNDLE:-"openvpn"}
if [ -z "$VPN_PROVIDER_HOME" ]; then
echo "ERROR: Need to have VPN_PROVIDER_HOME set to call this script" && exit 1
@@ -22,13 +21,10 @@ find "$VPN_PROVIDER_HOME" -type f ! -name "*.sh" -delete
# Download and extract wanted bundle into temporary file
tmp_file=$(mktemp)
echo "Downloading OpenVPN config bundle $PIA_OPENVPN_CONFIG_BUNDLE into temporary file $tmp_file"
curl -sSL "${baseURL}/${PIA_OPENVPN_CONFIG_BUNDLE}.zip" -o "$tmp_file"
curl -sSL --cookie /dev/null "${baseURL}/${PIA_OPENVPN_CONFIG_BUNDLE}.zip" -o "$tmp_file"
echo "Extract OpenVPN config bundle into PIA directory $VPN_PROVIDER_HOME"
unzip -qjo "$tmp_file" -d "$VPN_PROVIDER_HOME"
echo "Modify configs for this container"
find "$VPN_PROVIDER_HOME" -type f -name "*.ovpn" -print0 | xargs -n 1 -r0 /etc/openvpn/modify-openvpn-config.sh
# Select a random server as default.ovpn
ln -sf "$(find "$VPN_PROVIDER_HOME" -name "*.ovpn" | shuf -n 1)" "$VPN_PROVIDER_HOME"/default.ovpn
ln -sf "$(find "$VPN_PROVIDER_HOME" -name "*.ovpn" | shuf -n 1)" "$VPN_PROVIDER_HOME"/default.ovpn