summaryrefslogtreecommitdiff
path: root/src/conf_mode/ipsec-settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/ipsec-settings.py')
-rwxr-xr-xsrc/conf_mode/ipsec-settings.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/conf_mode/ipsec-settings.py b/src/conf_mode/ipsec-settings.py
index b59063fcd..b02f3bcb0 100755
--- a/src/conf_mode/ipsec-settings.py
+++ b/src/conf_mode/ipsec-settings.py
@@ -214,16 +214,22 @@ def restart_ipsec():
except OSError:
raise ConfigError('VPN configuration error: IPSec process did not start.')
-def apply(data):
- # Restart IPSec daemon
- restart_ipsec()
+def apply(data, config):
+ if config.exists("vpn ipsec site-to-site peer") or \
+ config.exists("vpn ipsec profile") or \
+ config.exists("vpn l2tp remote-access ipsec-settings"):
+ # Restart IPSec daemon
+ restart_ipsec()
+ else:
+ print()
if __name__ == '__main__':
try:
- c = get_config()
+ vyos_config = Config()
+ c = get_config(vyos_config)
verify(c)
generate(c)
- apply(c)
+ apply(c, vyos_config)
except ConfigError as e:
print(e)
exit(1)