Pavel Loginov 4 years ago committed by GitHub
parent 00912e8e71
commit a36066df13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,23 +38,20 @@ try:
service_ver, stderr = funct.subprocess_execute(cmd) service_ver, stderr = funct.subprocess_execute(cmd)
services.append([s, status, v, service_ver[0]]) services.append([s, status, v, service_ver[0]])
try: openvpn_configs = ''
stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client") openvpn_sess = ''
if stdout[0] != 'package openvpn3-client is not installed': openvpn = ''
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) stdout, stderr = funct.subprocess_execute("rpm --query openvpn3-client")
cmd = "sudo openvpn3 sessions-list|grep -E 'Config|Status'|awk -F\":\" '{print $2}'|awk 'ORS=NR%2?\" \":\"\\n\"'| sed 's/^ //g'" if stdout[0] != 'package openvpn3-client is not installed':
openvpn_sess, stderr = funct.subprocess_execute(cmd) 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 = stdout[0] openvpn_configs, stderr = funct.subprocess_execute(cmd)
else: cmd = "sudo openvpn3 sessions-list|grep -E 'Config|Status'|awk -F\":\" '{print $2}'|awk 'ORS=NR%2?\" \":\"\\n\"'| sed 's/^ //g'"
openvpn_configs = '' # cmd = 'echo "client.ovpn Connection, Client connected"'
openvpn_sess = '' openvpn_sess, stderr = funct.subprocess_execute(cmd)
openvpn = '' openvpn = stdout[0]
except Exception:
openvpn_configs = ''
openvpn_sess = ''
openvpn = ''
except Exception: except Exception:
pass pass

Loading…
Cancel
Save