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

Add WG_INTERFACE environment variable that defaults to "pia" #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lucasrangit
Copy link

@lucasrangit lucasrangit commented Jan 23, 2022

Allows overriding the default Wireguard interface "pia" .

Useful when you want to match the Wireguard default /etc/wireguard/wg0.conf (see https://www.wireguard.com/quickstart/).

For example, here is a 3rd party project where they added a similar feature.

https://github.com/triffid/pia-wg/blob/147ef7be1c7e1df6f020d4049535163353d392ee/pia-config.sh#L59

Tested on Ubuntu Server 20.04 and https://github.com/linuxserver/docker-wireguard Docker container.

@lucasrangit
Copy link
Author

I didn't see other WG_ variables documented in the README.md. However, if required I will add this and others.

@g00nix
Copy link
Contributor

g00nix commented Feb 19, 2022

Can you please add quotes based on shellcheck recommendations?

148: > "/etc/wireguard/${WG_INTERFACE}.conf" || exit 1
157: wg-quick up "$WG_INTERFACE"

I noticed these when reading through the commit. I didn't have time to modify/test myself.

@lucasrangit
Copy link
Author

Can you please add quotes based on shellcheck recommendations?

148: > "/etc/wireguard/${WG_INTERFACE}.conf" || exit 1
157: wg-quick up "$WG_INTERFACE"

I noticed these when reading through the commit. I didn't have time to modify/test myself.

Thanks @g00nix for the feedback. I fixed my changes and rebased the PR with the latest master.

Allows overriding the default Wireguard interface "pia" with "wg0" for example.

Useful when you want to match the Wireguard default `/etc/wireguard/wg0.conf` (see https://www.wireguard.com/quickstart/).
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

Successfully merging this pull request may close these issues.

2 participants