Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhotio committed Jan 22, 2024
1 parent 224db59 commit a48efc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions root/etc/s6-overlay/s6-rc.d/service-proton/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

umask "${UMASK}"

vpn_remote=$(grep -P -o -m 1 '(?<=^Endpoint)(\s{0,})[^:]+' < "${CONFIG_DIR}/wireguard/${VPN_CONF}.conf"| sed -e 's~^[=\ ]*~~')
vpn_gw=$(grep -P -o -m 1 '(?<=^Address)(\s{0,})[^/]+' < "${CONFIG_DIR}/wireguard/${VPN_CONF}.conf"| sed -e 's~^[=\ ]*~~')

while true; do
if ! natpmpc -g "${vpn_remote}"; then
echo "[WARNING] ProtonVPN endpoint \"${vpn_remote}\" does not support port forwarding!"
if ! natpmpc -g "${vpn_gw%.*}.1" &> /dev/null; then
echo "[WARNING] ProtonVPN endpoint \"${vpn_gw%.*}.1\" does not support port forwarding!"
else
port=$(natpmpc -g "${vpn_remote}" -a 1 0 udp 60 | grep -P -o -m 1 '(?<=Mapped public port\s)\d+')
port=$(natpmpc -g "${vpn_gw%.*}.1" -a 1 0 udp 60 | grep -P -o -m 1 '(?<=Mapped public port\s)\d+')
if [[ -n "${port}" ]]; then
natpmpc -g "${vpn_remote}" -a 1 0 tcp 60
natpmpc -g "${vpn_gw%.*}.1" -a 1 0 tcp 60 &> /dev/null
webui_https="http"
if grep -q 'WebUI\\HTTPS\\Enabled=true' "${CONFIG_DIR}/config/qBittorrent.conf"; then
webui_https="https"
Expand Down

0 comments on commit a48efc5

Please sign in to comment.