Changed transmission to deluge. Simplify ufw rules

This commit is contained in:
Eldwan Brianne
2020-11-10 23:31:05 +01:00
parent 3d97cd5302
commit 69bd27150f
10515 changed files with 666 additions and 2369 deletions

View File

@@ -0,0 +1,34 @@
#! /bin/bash
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
baseURL="https://www.privateinternetaccess.com/openvpn"
PIA_OPENVPN_CONFIG_BUNDLE=${PIA_OPENVPN_CONFIG_BUNDLE:-"openvpn-nextgen"}
if [ -z "$VPN_PROVIDER_HOME" ]; then
echo "ERROR: Need to have VPN_PROVIDER_HOME set to call this script" && exit 1
fi
# Delete all files for PIA provider, except scripts
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"
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