-
Notifications
You must be signed in to change notification settings - Fork 60
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
Custom Scripts #33
Comments
That seems easy enough to do and could be useful. Would something like this work? Note that if a custom script fails the container will only exit if I've built and tagged it as |
Wow you are fast! The code looks great, I will test it when I'm back at my computer. Thank you for your time doing this. |
It works perfectly, I greatly appreciate it!! I tested all the scripts and they all work as expected. For anyone else who might come across this, make sure your scripts are executable ( |
Thanks for testing. It should be in the Docker hub build soon. |
Hey there. I love this repo, it is very useful. Thanks for your work on it.
Summary
I would like to consider adding support for custom scripts written by the end user, to be run at various points in this container's lifecycle.
Suggested Implementation
pre-up.sh
Runs before WireGuard is brought up or iptables rules are created; essentially runs right away on container start.post-up.sh
Runs after WireGuard is brought up and iptables rules are established, right before we would normally sleep.pre-down.sh
Runs on container stop before bringing WireGuard down or removing any iptables rules.post-down.sh
Runs on container stop after bringing WireGuard down and removing iptables rules.The
run
entrypoint would look for these scripts in/pia/scripts
and run them at the right time if they exist. If the script fails, the container should exit there.Usage
In my case this is useful so that I can add custom iptables rules. I am running this container alongside another Wireguard container which requires an extra bit of networking. I could fork and modify this repo, but that would be excessive when all I need to do is run a couple commands.
Feedback
I'm of course open to ideas, opinions, criticisms, etc., and I am also willing to implement this.
Thanks for your consideration!
The text was updated successfully, but these errors were encountered: