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") cs[id_a].put(StringIO(config_a.to_wgconfig(wgquick_format = True)), f"/etc/wireguard/{name_a}.conf")
for p in predown_a: for p in predown_a:
try:
cs[id_a].run(p) cs[id_a].run(p)
except UnexpectedExit:
pass
cs[id_a].run(f"systemctl start wg-quick@{name_a}.service") 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") cs[id_b].put(StringIO(config_b.to_wgconfig(wgquick_format = True)), f"/etc/wireguard/{name_b}.conf")
for p in predown_b: for p in predown_b:
try:
cs[id_b].run(p) cs[id_b].run(p)
except UnexpectedExit:
pass
cs[id_b].run(f"systemctl start wg-quick@{name_b}.service") cs[id_b].run(f"systemctl start wg-quick@{name_b}.service")