fixed a vpnc issue

This commit is contained in:
Ezri Brimhall 2026-02-03 16:22:06 -07:00
parent 6279e9e860
commit e5b485b72e
Signed by: ezri
GPG Key ID: 058A78E5680C6F24

View File

@ -279,9 +279,11 @@ async def configure_with_networkd():
else:
filename = f"10-{config.tun_device}.network"
path = Path("/run/systemd/network") / filename
if config.reason in {Reason.CONNECT, Reason.ATTEMPT_RECONNECT, Reason.RECONNECT}:
# only write out the file if the reason indicates a new connection.
config.write_config(Path("/run/systemd/network") / filename)
config.write_config(path)
elif config.reason == Reason.PRE_INIT:
# idk what this does, but the script does it, so we will too.
try:
@ -296,7 +298,7 @@ async def configure_with_networkd():
os.close(fd)
return
elif config.reason == Reason.DISCONNECT:
config.destroy_config()
config.destroy_config(path)
# always reload networkd state unless it's the config.
bus = bus_var.get()
intro = await bus.introspect(