On 21/09/15 17:23, Gert Doering wrote:
> Hi,
>
> On Mon, Sep 21, 2015 at 05:17:06PM +0200, Jan Just Keijser wrote:
>> A client-connect script would be a much better option in this case.
>> Unfortunately, there is no env var that contains the number of connected
>> clients.
> Does the (internal) client ID show up in the environment?  For "modulo
> operations", this should be good enough...
>
just checked with 2.3.7: nope, does not show up in the list:

17:37:18: START client-connect script ===
argv = ./movpn-07-01-script.sh 
/tmp/openvpn_cc_8528c57f838033a03f38ddb72b57ae30.tmp
user = nobody/nobody
   MASTERING_OPENVPN=server
   PWD=/etc/openvpn/movpn
   SHLVL=1
   X509_0_C=ZA
   X509_0_CN=client1
   X509_0_O=Mastering OpenVPN
   X509_0_ST=Enlightenment
   X509_0_emailAddress=r...@example.org
   X509_1_C=ZA
   X509_1_CN=Mastering OpenVPN
   X509_1_L=Overall
   X509_1_O=Mastering OpenVPN
   X509_1_ST=Enlightenment
   X509_1_emailAddress=r...@example.org
   _=/bin/env
   common_name=client1
   config=movpn-07-01-server.conf
   daemon=0
   daemon_log_redirect=0
   daemon_pid=9160
   daemon_start_time=1437665634
   dev=tun0
   dev_type=tun
   ifconfig_broadcast=10.200.0.255
   ifconfig_ipv6_local=fd00::200:1
   ifconfig_ipv6_netbits=112
   ifconfig_ipv6_remote=fd00::200:2
   ifconfig_local=10.200.0.1
   ifconfig_netmask=255.255.255.0
   ifconfig_pool_netmask=255.255.255.0
   ifconfig_pool_remote_ip=10.200.0.2
   link_mtu=1541
   local_port_1=1194
   proto_1=udp
   redirect_gateway=0
   remote_port_1=1194
   script_context=init
   script_type=client-connect
   time_ascii=Thu Jul 23 17:37:18 2015
   time_unix=1437665838
tls_digest_0=1b:27:a6:b4:5f:7a:9c:3f:17:fb:ff:33:05:61:3f:2a:56:89:16:d3
tls_digest_1=e4:f1:43:37:34:51:de:99:7a:dc:e3:6d:f2:4c:5b:84:34:4b:f3:64
   tls_id_0=C=ZA, ST=Enlightenment, O=Mastering OpenVPN, CN=client1, 
emailAddress=r...@example.org
   tls_id_1=C=ZA, ST=Enlightenment, L=Overall, O=Mastering OpenVPN, 
CN=Mastering OpenVPN, emailAddress=r...@example.org
   tls_serial_0=2
   tls_serial_1=15173527578309581038
   tls_serial_hex_0=02
   tls_serial_hex_1=d2:93:32:f0:8e:bc:58:ee
   trusted_ip=a.b.c.d
   trusted_port=46171
   tun_mtu=1500
   untrusted_ip=a.b.c.d
   untrusted_port=46171
   username=movpn
   verb=1
17:37:18: END client-connect script ===


idem dito for the 'learn-address' script.

JJK


------------------------------------------------------------------------------
_______________________________________________
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to