File: ocserv-script

package info (click to toggle)
ocserv 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,924 kB
  • sloc: ansic: 46,747; sh: 12,630; makefile: 412; xml: 29
file content (14 lines) | stat: -rwxr-xr-x 389 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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