-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues adding .sh script on TUN up. #95
Comments
was hoping to hear something, I am just manually running the script every once in a while from inside the container... :P |
I have the same issue... ever found a solution, besides modifying the Dockerfile? |
on the server host, it has a timer which runs, and sends the command to the docker container to run that script. I think I set it to run every 2 hours. This was the simplest solution I could figure without needing to edit the docker container file itself |
I had the same exact issue and was able to solve it by passing VPN_OPTIONS --route-up /config/tun_up.sh |
@SoCraDi any chance you can share your exact environment variable and tun_up.sh script? |
So the script it replaces if you use the --up option is /root/openvpnup.sh, but the way the arguments are formatted in the start-script, I don't think you can use a hack to smash them together in one --up argument like mentioned here to make it happen: https://superuser.com/questions/505012/how-to-execute-multiple-scripts-when-openvpn-establishes/1618709#1618709?newreg=833809e0a807452fa0dd829e7bc53298 I tried adding -e "VPN_OPTIONS=--script-security 2 --route-delay 5 --route-up /config/persists/tun_up.sh", which at least executes according to supervisord.log, but fails to resolve the MAM domain name so the curl fails. Delaying longer just slows the startup down, and it looks like a lot of the routing stuff gets added by the start-script after --route-up is executed anyways. However, getting into an interactive shell on the docker and executing it from there after the tunnel is up DOES work (although you have to be wary of permissions and CRLF if you created the .sh file in windows or you get weird error messages that I had to google to understand). My solve was to create a cronjob/scheduled task on the host that executes every hour that just runs docker exec qbittorrentvpn sh -c '/config/persists/tun_up.sh' |
VPN_OPTIONS=--route-up /config/mam_tun_up.sh mam_tun_up.sh:
|
Weird that that works with a 5sec sleep in it but mine didn't work with a 5 sec startup delay. I'll have to try that out. |
Did anyone figure this out? I tried a couple of versions including the --route-up, but all I get is t.myanonymouse.net is unreachable or host not known. It works fine if I just run it after it's up. |
The URL in this comment is wrong, that might be it? Or it's getting to execute before the tunnel is up and has a working DNS server, tough to say |
this is what, from what i can tell, i just ran into. I added |
When attempting to follow the directions for a private tracker, they require an update of the IP from which qbit is downloading. I can run the command in the container manually, and it works. But if I add in the additional CLI options for OPVN it has this issue.
adding this to the compose causes this to occur:
This is the .sh which is just one line:
This essentially bricks the entire setup as nothing else finishes configuring.
Is there a better way for me to inject a script into the startup?
The text was updated successfully, but these errors were encountered: