Skip to content
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

How to set OVPN_EXTRA with multiple lines? #59

Open
skret028 opened this issue Mar 22, 2023 · 1 comment
Open

How to set OVPN_EXTRA with multiple lines? #59

skret028 opened this issue Mar 22, 2023 · 1 comment

Comments

@skret028
Copy link

skret028 commented Mar 22, 2023

I want to set static IP to a certain client.
As I searched,I shall add 2 lines to /etc/openvpn/server.conf
ifconfig-pool-persist ipp.txt
client-config-dir /etc/openvpn/ccd
And setup a file as /etc/openvpn/ccd/username
ifconfig-push 10.8.0.5 10.8.0.6

I tried to modify /etc/openvpn/server.conf,but it restores every launch.
I also tried to add -e OVPN_EXTRA="ifconfig-pool-persist /etc/openvpn/ipp.txt\nclient-config-dir /etc/openvpn/ccd" \
It seems the escape character '\n' dosen't work properly.

@skret028 skret028 changed the title How to set OVPN_EXTRA with multiple lanes? How to set OVPN_EXTRA with multiple lines? Mar 22, 2023
@wheelybird
Copy link
Owner

wheelybird commented Mar 24, 2023

This depends on how you're running Docker. Looks like you're passing arguments to docker run, so you could create a multiline variable, e.g.:

extraconfig="
ifconfig-pool-persist /etc/openvpn/ipp.txt
client-config-dir /etc/openvpn/ccd"

and then -e OVPN_EXTRA=$extraconfig. I think that should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants