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 lucasrangit force-pushed the support-output-file-env-var branch from 08f3505 to e9834e2 Compare February 19, 2022 16:57
@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.

@lucasrangit lucasrangit force-pushed the support-output-file-env-var branch from e9834e2 to 627409c Compare February 19, 2022 17:05
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/).
@lucasrangit lucasrangit force-pushed the support-output-file-env-var branch from 627409c to 71ff88e Compare March 1, 2022 19:40
@lucasrangit lucasrangit force-pushed the support-output-file-env-var branch from cc8f34b to 71ff88e Compare March 2, 2022 19:20
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