Ignore rm errors
This commit is contained in:
parent
32272650da
commit
bd76f6f6fa
4
woven.py
4
woven.py
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from fabric import Connection
|
from fabric import Connection
|
||||||
|
from invoke.exceptions import UnexpectedExit
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from sys import stderr
|
from sys import stderr
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
@ -51,7 +52,10 @@ def generate_wg_configs(config: WovenConfig):
|
||||||
cs = { id: Connection(node.listen_address, user = "root") for id, node in config.nodes.items() }
|
cs = { id: Connection(node.listen_address, user = "root") for id, node in config.nodes.items() }
|
||||||
for c in cs.values():
|
for c in cs.values():
|
||||||
c.run("for f in /etc/wireguard/*-loop.conf; do systemctl stop wg-quick@$(basename $f .conf).service; done")
|
c.run("for f in /etc/wireguard/*-loop.conf; do systemctl stop wg-quick@$(basename $f .conf).service; done")
|
||||||
|
try:
|
||||||
c.run("rm /etc/wireguard/*-loop.conf")
|
c.run("rm /etc/wireguard/*-loop.conf")
|
||||||
|
except UnexpectedExit:
|
||||||
|
pass
|
||||||
|
|
||||||
ptp_ipv4_network_iter = ptp_ipv4_network.subnets(new_prefix = config.ptp_ipv4_subnet)
|
ptp_ipv4_network_iter = ptp_ipv4_network.subnets(new_prefix = config.ptp_ipv4_subnet)
|
||||||
ptp_ipv6_network_iter = ptp_ipv6_network.subnets(new_prefix = config.ptp_ipv6_subnet)
|
ptp_ipv6_network_iter = ptp_ipv6_network.subnets(new_prefix = config.ptp_ipv6_subnet)
|
||||||
|
|
Loading…
Reference in New Issue