Ignore predown command exit codes

This commit is contained in:
LilyRose2798 2024-04-17 02:03:36 +10:00
parent 17d3fca3b3
commit 676934c175
1 changed files with 8 additions and 2 deletions

View File

@ -149,12 +149,18 @@ def generate_wg_configs(config: WovenConfig):
cs[id_a].put(StringIO(config_a.to_wgconfig(wgquick_format = True)), f"/etc/wireguard/{name_a}.conf")
for p in predown_a:
cs[id_a].run(p)
try:
cs[id_a].run(p)
except UnexpectedExit:
pass
cs[id_a].run(f"systemctl start wg-quick@{name_a}.service")
cs[id_b].put(StringIO(config_b.to_wgconfig(wgquick_format = True)), f"/etc/wireguard/{name_b}.conf")
for p in predown_b:
cs[id_b].run(p)
try:
cs[id_b].run(p)
except UnexpectedExit:
pass
cs[id_b].run(f"systemctl start wg-quick@{name_b}.service")