add python3.7 compatibility

pull/1/head
dadevel 4 years ago
parent 0515fafaf8
commit 19230eab45
No known key found for this signature in database
GPG Key ID: 1A8A9735430193D5

@ -8,7 +8,7 @@ A simple python script that implements the steps described at [wireguard.com/net
Requirements:
- Linux
- Python 3.8 or newer
- Python 3.7 or newer
- `ip` from `iproute2`
- `wg` from `wireguard-tools`
@ -34,5 +34,5 @@ Or connect a container to it.
podman run -it --rm --network ns:/var/run/netns/my-vpn alpine wget -O - https://ipinfo.io
~~~
You can find a `wg-quick@.service` equivalent at [extras/systemd/wg-netns@.service](./extras/systemd/wg-netns@.service).
You can find a `wg-quick@.service` equivalent at [wg-netns@.service](./wg-netns@.service).

@ -99,8 +99,8 @@ def setup_interface(wg_dir, netns_dir, name):
netns_dir = netns_dir/name
netns_dir.mkdir(parents=True, exist_ok=True)
if servers := wg_interface.get('dns'):
resolvconf = '\n'.join(f'nameserver {server}' for server in servers)
if wg_interface.get('dns'):
resolvconf = '\n'.join(f'nameserver {server}' for server in wg_interface['dns'])
netns_dir.joinpath('resolv.conf').write_text(resolvconf)

Loading…
Cancel
Save