From a36066df1315e73bbb9a0d21e0ca2609617ea416 Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Fri, 13 Nov 2020 21:38:18 +0600 Subject: [PATCH] v4.5.3.0 Changelog: https://haproxy-wi.org/changelog.py#4_5_3 --- app/users.py | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/app/users.py b/app/users.py index 4f36794b..13962dd2 100644 --- a/app/users.py +++ b/app/users.py @@ -38,23 +38,20 @@ try: service_ver, stderr = funct.subprocess_execute(cmd) services.append([s, status, v, service_ver[0]]) - try: - stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client") - if stdout[0] != 'package openvpn3-client is not installed': - cmd = "sudo openvpn3 configs-list |grep -E 'ovpn|(^|[^0-9])[0-9]{4}($|[^0-9])' |grep -v net|awk -F\" \" '{print $1}'|awk 'ORS=NR%2?\" \":\"\\n\"'" - openvpn_configs, stderr = funct.subprocess_execute(cmd) - cmd = "sudo openvpn3 sessions-list|grep -E 'Config|Status'|awk -F\":\" '{print $2}'|awk 'ORS=NR%2?\" \":\"\\n\"'| sed 's/^ //g'" - openvpn_sess, stderr = funct.subprocess_execute(cmd) - openvpn = stdout[0] - else: - openvpn_configs = '' - openvpn_sess = '' - openvpn = '' - except Exception: - openvpn_configs = '' - openvpn_sess = '' - openvpn = '' - + openvpn_configs = '' + openvpn_sess = '' + openvpn = '' + + stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client") + if stdout[0] != 'package openvpn3-client is not installed': + cmd = "sudo openvpn3 configs-list |grep -E 'ovpn|(^|[^0-9])[0-9]{4}($|[^0-9])' |grep -v net|awk -F\" \" '{print $1}'|awk 'ORS=NR%2?\" \":\"\\n\"'" + openvpn_configs, stderr = funct.subprocess_execute(cmd) + cmd = "sudo openvpn3 sessions-list|grep -E 'Config|Status'|awk -F\":\" '{print $2}'|awk 'ORS=NR%2?\" \":\"\\n\"'| sed 's/^ //g'" + # cmd = 'echo "client.ovpn Connection, Client connected"' + openvpn_sess, stderr = funct.subprocess_execute(cmd) + openvpn = stdout[0] + + except Exception: pass