tests: check whether IPs are being passed correctly to script when in proxyproto

That is check whether the remote IP passed is other than localhost,
and there is a non-empty IP_REAL_LOCAL.
This commit is contained in:
Nikos Mavrogiannopoulos
2015-08-22 20:07:59 +02:00
parent f8c7bccfa1
commit 8ed48a14bb
6 changed files with 55 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
#!/bin/sh
if [ "$REASON" = "connect" ];then
if test "$IP_REAL" != "127.0.0.1" && test "$IP_REAL" != "::1" && test -n "$IP_REAL_LOCAL";then
echo "$IP_REAL:$IP_REAL_LOCAL" >/tmp/connect/ok
fi
fi
exit 0