mirror of
https://github.com/haugene/docker-transmission-openvpn.git
synced 2025-09-03 21:01:11 +02:00
Delay --up script execution until after TCP/UDP connection establishment with peer. Also add error handling with logging when PIA port response is empty, issue #220
This commit is contained in:
parent
9671707d1d
commit
0ba2a55cbb
@ -44,7 +44,7 @@ echo $TRANSMISSION_RPC_PASSWORD >> /config/transmission-credentials.txt
|
||||
# Persist transmission settings for use by transmission-daemon
|
||||
dockerize -template /etc/transmission/environment-variables.tmpl:/etc/transmission/environment-variables.sh /bin/true
|
||||
|
||||
TRANSMISSION_CONTROL_OPTS="--script-security 2 --up /etc/transmission/start.sh --down /etc/transmission/stop.sh"
|
||||
TRANSMISSION_CONTROL_OPTS="--script-security 2 --up-delay --up /etc/transmission/start.sh --down /etc/transmission/stop.sh"
|
||||
|
||||
if [ -n "${LOCAL_NETWORK-}" ]; then
|
||||
eval $(/sbin/ip r l m 0.0.0.0 | awk '{if($5!="tun0"){print "GW="$3"\nINT="$5; exit}}')
|
||||
|
@ -31,11 +31,16 @@ fi
|
||||
# Get the port
|
||||
port_assignment_url="http://209.222.18.222:2000/?client_id=$pia_client_id"
|
||||
pia_response=$(curl -s -f $port_assignment_url)
|
||||
pia_curl_exit_code=$?
|
||||
|
||||
if [ -z $pia_response ]; then
|
||||
echo "Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding"
|
||||
fi
|
||||
|
||||
# Check for curl error (curl will fail on HTTP errors with -f flag)
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "curl encountered an error looking up new port: $ret"
|
||||
if [ $pia_curl_exit_code -ne 0 ]; then
|
||||
echo "curl encountered an error looking up new port: $pia_curl_exit_code"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check for errors in PIA response
|
||||
|
Loading…
x
Reference in New Issue
Block a user