summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-08-24 19:30:53 +0200
committerChristian Poessinger <christian@poessinger.com>2022-08-24 19:41:00 +0200
commitf5360b98703e0a954066c099b48119daecd1c12b (patch)
treeacc1035627739ba50244c097e1cfa3bc5c0d2420 /src/conf_mode
parent4d34c858d05afd720ed8f5cae0718b8e2c056f30 (diff)
downloadvyos-1x-f5360b98703e0a954066c099b48119daecd1c12b.tar.gz
vyos-1x-f5360b98703e0a954066c099b48119daecd1c12b.zip
ipsec: T2185: use systemd to start/stop service
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/vpn_ipsec.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/conf_mode/vpn_ipsec.py b/src/conf_mode/vpn_ipsec.py
index bad9cfbd8..5ca32d23e 100755
--- a/src/conf_mode/vpn_ipsec.py
+++ b/src/conf_mode/vpn_ipsec.py
@@ -595,13 +595,11 @@ def wait_for_vici_socket(timeout=5, sleep_interval=0.1):
sleep(sleep_interval)
def apply(ipsec):
+ systemd_service = 'strongswan-starter.service'
if not ipsec:
- call('sudo ipsec stop')
+ call(f'systemctl stop {systemd_service}')
else:
- call('sudo ipsec restart')
- call('sudo ipsec rereadall')
- call('sudo ipsec reload')
-
+ call(f'systemctl reload-or-restart {systemd_service}')
if wait_for_vici_socket():
call('sudo swanctl -q')