Hi,
Actually I want to record total bandwidth usage in a session by a client in DB.
I have my client disconnect script.
In disconnect script ENV I can get $bytes_received , $bytes_sent.
But the problem is when Client disconnects ( may be any reason) server takes more than a Minute in some cases to execute Disconnect script and there may be valid reason for it.( Keep alive variable is set properly )
So my concern is if Client quickly reconnect again before the <disconn.sh> gets executed for the previous session- what will happen !!
I tested that disconn.sh always run even even after User have a new session.
the bandwidth usage in the previous session which will be passed as ENV variable . be overridden when disconn.sh starts getting executed.?.Will I get ambiguous value mixing up with current sessions usage..
I am just trying to test it but not able to come into conclusion.
If any body pls help me on this.
Thanks
asu
cat disconn.sh
#!/bin/sh
echo $ifconfig_pool_local_ip >> /etc/openvpn/g.txt
echo $trusted_ip >> /etc/openvpn/h.txt
echo $trusted_port >> /etc/openvpn/i.txt
echo $common_name >> /etc/openvpn/j.txt
echo $bytes_received >> /etc/openvpn/k.txt
echo $bytes_sent >> /etc/openvpn/l.txt
exit 0
Server- Config-
client-connect /etc/openvpn/conn.sh
client-disconnect /etc/openvpn/disconn.sh