From 98576f5b2736b258460cc4430f4013ae3ca9a5ab Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Tue, 3 Feb 2026 15:08:40 -0700 Subject: [PATCH] now removes dropins if the directory already exists --- src/vpn_manager_globalprotect/vpnc.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vpn_manager_globalprotect/vpnc.py b/src/vpn_manager_globalprotect/vpnc.py index 3a3486f..3913460 100644 --- a/src/vpn_manager_globalprotect/vpnc.py +++ b/src/vpn_manager_globalprotect/vpnc.py @@ -199,8 +199,14 @@ class Config: f"Priority={self.routingpolicyrule_prio}\n", ] ) - dir = path.with_suffix(".d") - if not dir.exists(): + dir = path.with_suffix(".network.d") + if dir.is_dir(): + for file in dir.iterdir(): + # Remove all files in the directory. + file.unlink() + elif dir.exists(): + dir.unlink() + else: dir.mkdir() for net in self.split_tunnel_inclusions: self.write_route(dir, net)