transmission-post-start.sh - unable to resolve URL #2111
-
Hi, I am having issues running the transmission-post-start.sh script below:
As you can see from the logs below, for some reason I am unable to resolve t.XXXX.net, does anyone have any suggestions? Thanks :-)
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Well, once the Tunnel is up, check inside the container if it can resolve or not. Seems like the vpn dns isn’t resolving it |
Beta Was this translation helpful? Give feedback.
-
Sorry, should have mentioned that I had already tried that without issues:
|
Beta Was this translation helpful? Give feedback.
-
In my case, the underlying issue is that OpenVPN adds routes after the script is executed. As a result, when the pre-start script runs, the tunnel is up but nothing is routed through the VPN. You can override DNS settings, but this will end up routing through the host, which results in your public IP being sent to the API. To mitigate this, I modified the script to retry the API call on failure. FYI @TheBrickster, I think we are trying to do exactly the same thing - "dynamicSeedbox.php" gave it away ;) #!/bin/bash
# /scripts/transmission-pre-start.sh
function schedule_retry {
# Doing it this way because the container does not have `at` installed...
echo "Scheduling retry..."
nohup bash -c "sleep 1; "$0" "$@" >> /tmp/transmission-pre-start.log 2>&1" &
}
# Update dynamic session IP.
# This allows downloading from a VPN IP that is not the same as the browsing IP.
function update_ip {
echo "Attempting to update IP..."
# This is optional - it just logs the current IP for debugging
# curl ifconfig.me && \
curl -c /config/xxx.cookies -b /config/xxx.cookies https://t.xxx.net/json/dynamicSeedbox.php && \
echo "Updated session IP!"
}
update_ip
retval=$?
if [ $retval -ne 0 ]; then
schedule_retry
else
echo "Success!"
fi |
Beta Was this translation helpful? Give feedback.
In my case, the underlying issue is that OpenVPN adds routes after the script is executed. As a result, when the pre-start script runs, the tunnel is up but nothing is routed through the VPN. You can override DNS settings, but this will end up routing through the host, which results in your public IP being sent to the API.
To mitigate this, I modified the script to retry the API call on failure. FYI @TheBrickster, I think we are trying to do exactly the same thing - "dynamicSeedbox.php" gave it away ;)