#!/bin/sh . /usr/lib/libmodcgi.sh . /mod/etc/conf/openvpn.cfg NAMES="${OPENVPN_CONFIG_NAMES#*\#}" NAMES="openvpn${NAMES//#/\nopenvpn_}" MODE="${OPENVPN_MODE#*\#}" LOG="${OPENVPN_LOGFILE#*\#}" nth() { echo -e "${2//#/\n}" | sed -n "$1 p" } cgi_begin "OpenVPN Clients" sec_begin '$(lang de:"Verbundene VPN-Clients" en:"Connected clients")' sec-connected echo "
$(lang de:"Laut Status-Datei sind folgende Clients verbunden:" en:"Status file entries of connected sessions:")
" c=1 for config in $(echo -e "$NAMES"); do if [ "yes" = "$(nth $c $LOG)" -a "server" = "$(nth $c $MODE)" -a -r /var/log/${config}.log ]; then [ $OPENVPN_CONFIG_COUNT -gt 1 ] && echo "$(lang de:"Konfiguration" en:"Configuration") ${config} " echo 'Clientname | IP | $(lang de:"verbunden seit" en:"connected since") |
---|---|---|
\1 | \2 | \3 |
$(lang de:"Angezeigt nur für konfigurierte Server mit angewählter Option \"Statusprotokoll\"" en:"Shown only for server configurations with selected option \"Log status\"")
' sec_end cgi_end