summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-wireguard.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-wireguard.py b/src/conf_mode/interfaces-wireguard.py
index 013a07f32..cac911c8c 100755
--- a/src/conf_mode/interfaces-wireguard.py
+++ b/src/conf_mode/interfaces-wireguard.py
@@ -169,6 +169,10 @@ def get_config():
if key_eff != key_cfg and key_eff != None:
wg['peer_remove'].append(key_cfg)
+ # if a peer is disabled, we have to exec a remove for it's pubkey
+ else:
+ peer_key = c.return_value('peer {peer} pubkey'.format(peer=p))
+ wg['peer_remove'].append(peer_key)
return wg
@@ -191,6 +195,7 @@ def verify(c):
if not c['peer'][p]['pubkey']:
raise ConfigError("peer pubkey required for peer " + p)
+
def apply(c):
# no wg configs left, remove all interface from system
# maybe move it into ifconfig.py