Files
ocserv/doc/scripts/ocserv-script
Nikos Mavrogiannopoulos d6583945f9 Added the STATS_DURATION script environment variable.
This variable reports the duration of the session in seconds.
2014-05-04 11:20:32 +02:00

15 lines
389 B
Bash
Executable File

#!/bin/sh
if [ "$REASON" = "connect" ];then
# Disable the firewall for the user's device
iptables -A INPUT -i $DEVICE -j ACCEPT
echo "User '$USERNAME' from '$IP_REAL' connected. Local IP is '$IP_REMOTE'"
else
iptables -D INPUT -i $DEVICE -j ACCEPT
echo "User '$USERNAME' from '$IP_REAL' disconnected (in: $STATS_BYTES_IN, out: $STATS_BYTES_OUT, time: $STATS_DURATION)."
fi
exit 0