summaryrefslogtreecommitdiff
path: root/src/op_mode/openconnect-control.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/op_mode/openconnect-control.py')
-rwxr-xr-xsrc/op_mode/openconnect-control.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/op_mode/openconnect-control.py b/src/op_mode/openconnect-control.py
index c3cd25186..a128cc011 100755
--- a/src/op_mode/openconnect-control.py
+++ b/src/op_mode/openconnect-control.py
@@ -19,7 +19,10 @@ import argparse
import json
from vyos.config import Config
-from vyos.util import popen, run, DEVNULL
+from vyos.util import commit_in_progress
+from vyos.util import popen
+from vyos.util import run
+from vyos.util import DEVNULL
from tabulate import tabulate
occtl = '/usr/bin/occtl'
@@ -57,6 +60,10 @@ def main():
# Check is Openconnect server configured
is_ocserv_configured()
+ if commit_in_progress():
+ print('Cannot restart openconnect while a commit is in progress')
+ exit(1)
+
if args.action == "restart":
run("sudo systemctl restart ocserv.service")
sys.exit(0)