diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-09-09 06:45:40 +0000 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-09-09 06:45:40 +0000 |
commit | e41ae4d952e276d8497d38f5761806c14ea542d2 (patch) | |
tree | ac30396d42616eefa40a31f7091aa23d84feefb5 /src | |
parent | b6b61bc9ecf1328e67a0c15934f8bf3966a6b66d (diff) | |
download | vyos-1x-e41ae4d952e276d8497d38f5761806c14ea542d2.tar.gz vyos-1x-e41ae4d952e276d8497d38f5761806c14ea542d2.zip |
openconnect: T2036: Move CLI commands under vpn openconnect
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/vpn_openconnect.py (renamed from src/conf_mode/vpn_anyconnect.py) | 14 | ||||
-rwxr-xr-x | src/op_mode/openconnect-control.py (renamed from src/op_mode/anyconnect-control.py) | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/conf_mode/vpn_anyconnect.py b/src/conf_mode/vpn_openconnect.py index 158e1a117..af8604972 100755 --- a/src/conf_mode/vpn_anyconnect.py +++ b/src/conf_mode/vpn_openconnect.py @@ -42,7 +42,7 @@ def get_hash(password): def get_config(): conf = Config() - base = ['vpn', 'anyconnect'] + base = ['vpn', 'openconnect'] if not conf.exists(base): return None @@ -61,24 +61,24 @@ def verify(ocserv): if "mode" in ocserv["authentication"]: if "local" in ocserv["authentication"]["mode"]: if not ocserv["authentication"]["local_users"] or not ocserv["authentication"]["local_users"]["username"]: - raise ConfigError('Anyconect mode local required at leat one user') + raise ConfigError('openconnect mode local required at leat one user') else: for user in ocserv["authentication"]["local_users"]["username"]: if not "password" in ocserv["authentication"]["local_users"]["username"][user]: raise ConfigError(f'password required for user {user}') else: - raise ConfigError('anyconnect authentication mode required') + raise ConfigError('openconnect authentication mode required') else: - raise ConfigError('anyconnect authentication credentials required') + raise ConfigError('openconnect authentication credentials required') # Check ssl if "ssl" in ocserv: req_cert = ['ca_cert_file', 'cert_file', 'key_file'] for cert in req_cert: if not cert in ocserv["ssl"]: - raise ConfigError('anyconnect ssl {0} required'.format(cert.replace('_', '-'))) + raise ConfigError('openconnect ssl {0} required'.format(cert.replace('_', '-'))) else: - raise ConfigError('anyconnect ssl required') + raise ConfigError('openconnect ssl required') # Check network settings if "network_settings" in ocserv: @@ -90,7 +90,7 @@ def verify(ocserv): else: ocserv["network_settings"]["push_route"] = "default" else: - raise ConfigError('anyconnect network settings required') + raise ConfigError('openconnect network settings required') def generate(ocserv): diff --git a/src/op_mode/anyconnect-control.py b/src/op_mode/openconnect-control.py index 6382016b7..ef9fe618c 100755 --- a/src/op_mode/anyconnect-control.py +++ b/src/op_mode/openconnect-control.py @@ -28,7 +28,7 @@ occtl_socket = '/run/ocserv/occtl.socket' def show_sessions(): out, code = popen("sudo {0} -j -s {1} show users".format(occtl, occtl_socket),stderr=DEVNULL) if code: - sys.exit('Cannot get anyconnect users information') + sys.exit('Cannot get openconnect users information') else: headers = ["interface", "username", "ip", "remote IP", "RX", "TX", "state", "uptime"] sessions = json.loads(out) @@ -38,11 +38,11 @@ def show_sessions(): if len(ses_list) > 0: print(tabulate(ses_list, headers)) else: - print("No active anyconnect sessions") + print("No active openconnect sessions") def is_ocserv_configured(): - if not Config().exists_effective('vpn anyconnect'): - print("vpn anyconnect server is not configured") + if not Config().exists_effective('vpn openconnect'): + print("vpn openconnect server is not configured") sys.exit(1) def main(): @@ -54,7 +54,7 @@ def main(): args = parser.parse_args() - # Check is IPoE configured + # Check is Openconnect server configured is_ocserv_configured() if args.action == "restart": |